Hello,

It's always good practice to put some error detection in your code, i.e. 
$result = mysql_query($query)
or die(mysql_error());

I think your problem is the mysql does not like your query, but you are not 
catching it until PHP tries to figure out the number of rows returned by the 
query.  

HTH
-Brad
 

> Hello guys
> 
> This is my first posting to the list, even though I've had some
experienc> e 
> 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