[eluser]kingconnections[/eluser]
I am moving this a site over for a client and it uses codeigniter. I am a complete noob to this framework. I got everything copied over and all. I changed the database info in the database.php file. But I get this mysql can not connect to socket error.
Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2)
If I use the standard coding skills I am able to connect to the db fine. ie
$conn = mysql_connect('host.sever.net','user1','User1');
if (!conn) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
if (!mysql_select_db("test")) {
echo "Unable to select mydbname: " . mysql_error();
exit;
}
$sql = "SELECT email
FROM user
";
$result = mysql_query($sql);
if (!$result) {
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}
if (mysql_num_rows($result) == 0) {
echo "No rows found, nothing to print so am exiting";
exit;
}
// While a row of data exists, put that row in $row as an associative array
// Note: If you're expecting just one row, no need to use a loop
// Note: If you put extract($row); inside the following loop, you'll
// then create $userid, $fullname, and $userstatus
while ($row = mysql_fetch_assoc($result)) {
echo $row["email"];
echo "<br>";
}
mysql_free_result($result);
mysql_close($conn);
Any ideas? Any help would be great!!!