|
-
Jan 8th, 2007, 05:19 PM
#1
Thread Starter
New Member
[RESOLVED] MYSQL Won't work at all
Hey guys, as the title says, MYSQL isn't working.
Using home computer (XP) to build a website, and its my first time using MYSQL. I have apache (2.2.3) and PHP (5.2.0) working fine, and decided to include a database for this site I'm doing. So i downloaded MYSQL (5.0.27), and installed it, expecting it to work as easily as apache and PHP have done in the past, but no, it wants to be different.
I try to connect, but doesn't seem to get past there:
Code:
<?php
echo "hello"; //This is displayed.
$con = mysql_connect("localhost","username","password");
echo "hi"; //It doesn't reach here, meaning something is wrong with above line.
//more code
?>
Yes i have completely switched off the firewall, made sure the username/password is correct, etc etc.
I also read somewhere that...
Code:
<?php
phpinfo();
?>
...would display information relating to MYSQL if installed, but it only brings up PHP info.
I have now installed it at least 8 times over the past few days, each time making sure the previous installed files/registry settings are gone, rebooting afterwards, and even using guides to make sure I'm doing it properly. No luck so far. Anyone have any ideas?
There are probably better places to ask this, but what the hell
-
Jan 8th, 2007, 05:38 PM
#2
Re: MYSQL Won't work at all
try looking at the error messages generated by apache in error.log, or just use:
Code:
$con = mysql_connect("localhost","username","password") or die(mysql_error());
a call to phpinfo() will just tell you if the libraries are installed, and they are included by default (in 4 at least, haven't dabbled in 5 so I'm not sure if it comes with it or not -- but I assume so).
-
Jan 8th, 2007, 06:00 PM
#3
Re: MYSQL Won't work at all
It will tell you if the PHP extension is installed, to be precise - and I'm not sure if this is the default case in 5.2.x.
What you really should change are your error reporting settings in PHP. If it dies with a fatal error, it should emit an error message. Check the error_reporting value in your php.ini.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 8th, 2007, 07:16 PM
#4
Re: MYSQL Won't work at all
Look for a MySql section in the phpinfo() output. If its not there you need to enable the extension.
You also need to ensure that you have installed mysql and the root installation directory is in the PATH environment variable or the libmysql.dll is in the Windows directory.
-
Jan 9th, 2007, 12:22 PM
#5
Thread Starter
New Member
Re: MYSQL Won't work at all
Thanks for your help guys - mistake realised!
Cheers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|