can't connect to mysql
Posted: Sun Mar 04, 2007 3:56 pm
feyd | Please use
The only thing that shows up is "test". I don't receive any kind of error message even if I turn on error messages and display errors in php.ini.
I'm using php5 with apache 2.2 and the latest version of mysql.
Is there something I'm doing wrong or a way I can fix this problem?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I installed php, apache and mysql. The installations seem okay, but I'm unable to connect to mysql for some reason. PHP is working fine, because I can do anything that doesn't involve mysql.
The code I'm 'trying' to use is this:Code: Select all
<?php
echo "test";
$con = mysql_connect("localhost");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
echo "connected?";
}
mysql_close($con);
?>I'm using php5 with apache 2.2 and the latest version of mysql.
Is there something I'm doing wrong or a way I can fix this problem?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]