PHP/Mysql query problem
Moderator: General Moderators
-
shruti0324
- Forum Newbie
- Posts: 4
- Joined: Thu Dec 06, 2007 11:44 pm
PHP/Mysql query problem
i have written a code in PHP which connects to the database,my code is correct but im not getting the output on the screen,im getting cannot connect to mysql.what may be the problem.Im using PCQ Linux 2005,Mysql version is 12.22 Distrib 4.0.23 for pc-linux(i686)
Re: PHP/Mysql query problem
Since it isn't working, what makes you think that your code is correct? Seriously, you haven't given us any way to know what the problem is. If it says that it cannot connect to mysql, that's exactly what the problem is. Either the mysql server isn't running on the host that you named in your connect statement, or it doesn't recognize the mysql user or password.shruti0324 wrote:i have written a code in PHP which connects to the database,my code is correct but im not getting the output on the screen,im getting cannot connect to mysql.what may be the problem.Im using PCQ Linux 2005,Mysql version is 12.22 Distrib 4.0.23 for pc-linux(i686)
-
shruti0324
- Forum Newbie
- Posts: 4
- Joined: Thu Dec 06, 2007 11:44 pm
PHP/Mysql query
I know my code is correct as i have executed before the code in my college,but at home its not giving the output.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: PHP/Mysql query
Well then, you will have a different server, user and password, you don't know if the server is running, you're in an entirely different environment. The fact that your code worked at school doesn't mean that it will work in a different computer network. You must start with determining if your mysql server is running. Do you have other scripts that connect with the database at home? Can you connect to mysql server from the command line? Do you even have mysql server running at home?shruti0324 wrote:I know my code is correct as i have executed before the code in my college,but at home its not giving the output.
I bet someone read your source code and that broke it.
Please see http://en.wikipedia.org/wiki/Unusual_so ... roedinbugs
Please see http://en.wikipedia.org/wiki/Unusual_so ... roedinbugs
Sort of an old thread but I just read this wikipedia entry .. and it sort of made me laugh, is that a joke? Do those really exist or are they myths?astions wrote:I bet someone read your source code and that broke it.
Please see http://en.wikipedia.org/wiki/Unusual_so ... roedinbugs
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact: