Hi

Couple of points, you probably have an SQL error,

I use

echo $query;
echo '<br>'.mysql_error();

which shows the query and the error

you use 'author-cat' in the table name
and 'author_cat' and 'author-cat' in the where clause which will throw an
error.

HTH

Peter



-----------------------------------------------
Excellence in internet and open source software
-----------------------------------------------
Sunmaia
www.sunmaia.net
tel. 0121-242-1473
-----------------------------------------------

-----Original Message-----
From: Wilmar Perez [mailto:[EMAIL PROTECTED]]
Sent: 06 September 2002 16:51
To: php-db mailing list
Subject: [PHP-DB] not a valid MySQL result


Hello guys

This is my first posting to the list, even though I've had some experience
with C++, these are my first steps with php and mysql.

Well, the thing is that I'm getting the following message:

Warning: Supplied argument is not a valid MySQL result resource
in /var/www/bva/new/main/colecciones.php on line 35

The code is shown below:

$query_cat = "select author_names || ' ' || author_surnames
              from author, author-cat
              where author_cat.cat_code = $code
              and author.author_code = author-cat.author_code";


$result_cat = mysql_query($query_cat);

$num_results_cat = mysql_num_rows($result_cat);  //This is line 35


I did the same with a simpler select sentence and it worked alright, so I
guess there's a problem with the select sentence but haven't been able to
find it.

Does anyone have an idea?

Thanks a lot for your help.

*******************************************************
                         Wilmar Pérez
                     Network Administrator
                       Library System
                      Tel: ++57(4)2105145
                    University of Antioquia
                       Medellín - Colombia
                              2002
*******************************************************



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



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

Reply via email to