Re: Help w/ displaying return vals
| From: | JJeffman | Date: | Wed, 14 Mar 2001 23:11:13 +0000 |
| Subject: | Re: Help w/ displaying return vals | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-7495@lists.php.net to get a copy of this message | ||
Use <mysql_function(...)> or die( mysql_error()) on every mysql function
or command you're performing, this will tell you what is going wrong .
HTH
Jayme.
-----Mensagem Original-----
De: <ryan_gamo@edwards.com>
Para: <php-db@lists.php.net>
Cc: <Greg_Ziarko@edwards.com>
Enviada em: quarta-feira, 14 de março de 2001 19:47
Assunto: [PHP-DB] Help w/ displaying return vals
> Here's my php program, I think $result never gets assigned a value,
staying
> null or whatever.
>
> $link = mysql_connect("host");
>
> mysql_select_db("dbname");
>
> $result = mysql_query ("SELECT * FROM table");
>
> $fields = mysql_num_fields ($result);
> $rows = mysql_num_rows ($result);
>
> $table = mysql_field_table ($result, $i);
>
> echo "Your '".$table."' table has ".$fields." fields and
> ".$rows." records
> <BR>"
>
> - - EOP - -
>
> The problem comes on the lines that reference the variable $result.
>
> I keep getting this in the browser... leading me to believe that $result
is
> null:
>
> Warning: Supplied argument is not a valid MySQL result resource
>
>
> help!
>
> Thankx0r
>
> Ryan
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>