What wrong in this code
dear friends
i have this code: Quote:
|
Hi
If there are no rows returned, it will die. Kind of like this Code:
$cnt = 0 or die(mysql_error()); Try instead: Code:
$result = mysql_query("select mahang from shop_hang where macatalog='$macatalog'") or die (mysql_error()); |
i had tried but it died, too. Actually, your and my code is the same.
|
What is the error message - mysql_error should show it, no?
|
Nothing happened. But in my localserver, runs always correct with my code.
|
Hmm... I don't know. Production servers are often set up to not show any error messages, but only log them. Check the error logs if you have access to them. Otherwise, perhaps try:
error_reporting(E_ALL ^ E_NOTICE); or maybe: error_reporting(E_ALL); Last one usually gives lots of warnings. |
But my server doesnot print error. So how to know what error? It runs correct!
|
Could be a few things, like:
- The table/column is missing in the database on the production server - No php-mysql installed - register globals are turned off, so $macatalog is empty - the error is elsewhere? Did you try the error_reporting in the beginning of the script? It should give you a clue what the problem is. |
no in there error. i had checked. Correct everything. Using software to check is correct, too.
|
You sure it's that die that gets executed?
Maybe change it to something like: Code:
$result = mysql_query("select mahang from shop_hang where macatalog='$macatalog'") |
thank for help, i think i had found problem. When solve, i wil post.
|
All times are GMT -5. The time now is 01:33 AM. |