Warning: mysql_num_fields(): supplied argument is not a vali

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thosecars82
Forum Commoner
Posts: 94
Joined: Thu Apr 03, 2008 6:31 am
Location: Arganda, Madrid
Contact:

Warning: mysql_num_fields(): supplied argument is not a vali

Post by thosecars82 »

hello guys
I'm stuck with this problem.
It turns out that I just uploaded a kind of helloworld php web to freehostia to test it there and it works fine at there. Nevertheless it does not work on my computer. I am using xampp, apache and mysql. It seems mysql and appache are working. The errors i get are these:

Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\pruebalocal1\clase_mysql.inc.php on line 61

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\pruebalocal1\clase_mysql.inc.php on line 80

I do not understand why this work in the server and it does not work on my laptop.
The code which does not work is mysql_num_fields() and mysql_fetch_row().
Please, any help would be appreciated.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Warning: mysql_num_fields(): supplied argument is not a vali

Post by Christopher »

You probably do not have a connection to the database.
(#10850)
thosecars82
Forum Commoner
Posts: 94
Joined: Thu Apr 03, 2008 6:31 am
Location: Arganda, Madrid
Contact:

Re: Warning: mysql_num_fields(): supplied argument is not a vali

Post by thosecars82 »

thks Christopher. That was exactly the problem in my php file because i hadn't put exactly the name of the database i was using in mysql.thks again
Post Reply