RE: [PHP] error message while mysqling on php

2005-09-14 Thread Michal Krezolek
Thanks very much. I had an extra character when I was connecting to the
database. Now everything works!!!

-Original Message-
From: Alan Fullmer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 13, 2005 5:14 PM
To: 'Michal Krezolek'; php-general@lists.php.net
Subject: RE: [PHP] error message while mysqling on php

I see two things that could be it.

#1 your $result is not $result = mysql_query(queryline);

Or #2  your syntax on your query line is bad.

You can try doing something like this:

$query = SELECT * FROM table etc blah;
$result = mysql_query($query) or die(mysql_error());
$num = mysql_num_rows($result);


Sometimes the error message can be more explicit if you tell it to print it.
If you get no error on that query statement, then your query is fine.

 I have received an error: Warning: mysql_num_rows(): supplied argument is
 not a valid MySQL result resource in /home/www/mksystem.net when trying to
 execute $num = mysql_num_rows($result);
 
 Please go to http://mksystem.net/phpinfo.php and tell me whether it is due
 to the version of php I have on server and an easy workaround would be
 appreciated.

Check the syntax of your SQL statement, it's very possible you have an error
in it somewhere. If you have PHPMyAdmin, or some other interface to MySQL
such as MySQL Query Browser, etc, try executing the SQL statement in one of
them directly, to see if they return a valid resultset.

Much warmth,

Murray
---
Lost in thought...
http://www.planetthoughtful.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] error message while mysqling on php

2005-09-13 Thread Jay Blanchard
[snip]
I have received an error: Warning: mysql_num_rows(): supplied argument is
not a valid MySQL result resource in /home/www/mksystem.net when trying to
execute $num = mysql_num_rows($result);
[/snip]

Post a little code and we might be able to help you. It is likely that
$result is not the variable holding the resources from the query.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] error message while mysqling on php

2005-09-13 Thread Murray @ PlanetThoughtful
 I have received an error: Warning: mysql_num_rows(): supplied argument is
 not a valid MySQL result resource in /home/www/mksystem.net when trying to
 execute $num = mysql_num_rows($result);
 
 Please go to http://mksystem.net/phpinfo.php and tell me whether it is due
 to the version of php I have on server and an easy workaround would be
 appreciated.

Check the syntax of your SQL statement, it's very possible you have an error
in it somewhere. If you have PHPMyAdmin, or some other interface to MySQL
such as MySQL Query Browser, etc, try executing the SQL statement in one of
them directly, to see if they return a valid resultset.

Much warmth,

Murray
---
Lost in thought...
http://www.planetthoughtful.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] error message while mysqling on php

2005-09-13 Thread Alan Fullmer
I see two things that could be it.

#1 your $result is not $result = mysql_query(queryline);

Or #2  your syntax on your query line is bad.

You can try doing something like this:

$query = SELECT * FROM table etc blah;
$result = mysql_query($query) or die(mysql_error());
$num = mysql_num_rows($result);


Sometimes the error message can be more explicit if you tell it to print it.
If you get no error on that query statement, then your query is fine.

-Original Message-
From: Murray @ PlanetThoughtful [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 13, 2005 3:05 PM
To: 'Michal Krezolek'; php-general@lists.php.net
Subject: RE: [PHP] error message while mysqling on php

 I have received an error: Warning: mysql_num_rows(): supplied argument is
 not a valid MySQL result resource in /home/www/mksystem.net when trying to
 execute $num = mysql_num_rows($result);
 
 Please go to http://mksystem.net/phpinfo.php and tell me whether it is due
 to the version of php I have on server and an easy workaround would be
 appreciated.

Check the syntax of your SQL statement, it's very possible you have an error
in it somewhere. If you have PHPMyAdmin, or some other interface to MySQL
such as MySQL Query Browser, etc, try executing the SQL statement in one of
them directly, to see if they return a valid resultset.

Much warmth,

Murray
---
Lost in thought...
http://www.planetthoughtful.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php