Re: data_seek and fetch_row
| From: | Peter Beckman | Date: | Mon, 28 Oct 2002 20:59:31 +0000 |
| Subject: | Re: data_seek and fetch_row | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-22757@lists.php.net to get a copy of this message | ||
One problem: you are using a database wrapper for which you have provided
no information. $db->query is a function of a class $db, but we don't know
what that function does exactly.
Anyway, the $queryid doesn't contain a valid MySQL result resource. So go
back a few steps. Is $various_query a valid MySQL result? Print it. Keep
adding print statements all over the place until you find out when
$various_query is no longer (or if ever) a valid MySQL result resource.
My bet is that $db->query isn't returning a valid MySQL result. Do a print
after your query on $various_query and see what it shows. It should show:
Resource id #2
or something similar when you print it.
Peter
On Mon, 28 Oct 2002 V919V@aol.com wrote:
> Hi,
>
> I got a query and I want to jump through the results.Here's my query:
>
> $various_query = $db->query( "SELECT
> int_param5,
> char_param1,
> is_admin_pass
> FROM various" );
>
> And here I seek the data and fetch it into an array with mysql_fetch_row:
>
> $various = $db->seek( $various_query, 0 );
>
> function seek( $result, $row )
> {
>
> $result = mysql_data_seek( $result, $row );
> return $this->row( $result );
>
> }
>
> function row( $queryid )
> {
> $this->record = mysql_fetch_row( $queryid );
> return $this->record;
> }
> But if I load the page,I get this error:
> Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
> resource in
>
> What is wrong???
>
---------------------------------------------------------------------------
Peter Beckman Systems Engineer, Fairfax Cable Access Corporation
beckman@purplecow.com http://www.purplecow.com/
---------------------------------------------------------------------------