Re: Reset Informix Fetch Row

From: Date: Tue, 11 Jul 2000 07:28:58 +0000
Subject: Re: Reset Informix Fetch Row
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-1024@lists.php.net to get a copy of this message
Hi Dan, > Paul, > > Thank you. You're welcome. > That works great. Is there any way to do this when there is a blob > field. I get an error that says it can't use a curser with a blob field. I'm afraid I don't use blobs so can't help you with this one. The only thing I would require them for is images but I store them on the filesystem and just hold the path/filename in the DB. There *are* Informix users about. I would suggest re-posting possibly with a different subject line hi-lighting INFORMIX. - Paul - > > Dan > > > Paul Gardiner wrote: > > > Hi Dan > > > > You've probably gathered by now ther are not too many of us Informix users > > about. Never mind, I think what you need to play with is using the > > IFX_SCROLL in your query line. > > > > ifx_query("select blah from blah", $conn_id , IFX_SCROLL ); > > > > This sets up a SCROLL cursor which you can step back/forward/jump etc. Use > > the Keywords FIRST,LAST,NEXT,PREVIOUS,CURRENT,RELATIVE integer,ABSOLUTE > > integer in your ifx_fetch_row line. > > > > e.g. > > > > $row = ifx_fetch_row ($rid, "FIRST"); > > > > $row = ifx_fetch_row ($rid, "NEXT"); > > > > Hope you get the idea :-) > > > > Regards, > > - Paul - > > > > ----- Original Message ----- > > From: Dan Fitzpatrick <dan@rapidascent.com> > > To: <php-db@lists.php.net> > > Sent: 09 July 2000 03:38 > > Subject: [PHP-DB] Reset Informix Fetch Row > > > > > How do you reset an IFX_FETCH_ROW to start at row 0 after already > > > looping through the query results? I want to display a table of contents > > > menu for a page. Then loop through the same query to output the actual > > > body of each record. I could set a variable in the initial loop that > > > would be the content of the output for what would have been that second > > > loop, but I don't know if that is the most efficient solution. > > > > > > Example: > > > > > > // Query results = 10 records with the fields: recordid, title, body > > > // Output a table of contents for the page > > > echo "<ul>"; > > > while ($row = ifx_fetch_row($results)) { > > > $id = $row[recordid]; > > > $title = $row[title]; > > > echo "<li><a href=#a$id>$title</a>\n"; > > > } > > > echo "</ul><hr>"; > > > > > > // This is what I use in MySQL > > > mysql_data_seek ($results, 0); // How do you do this with Informix? > > > > > > // Output the same query with the anchor, title, and body of the content > > > > > > while ($row = ifx_fetch_row($results)) { > > > $id = $row[recordid]; > > > $title = $row[title]; > > > $body = $row[body]; > > > echo "<a > > > name=a$id></a><br><b>$title</b><br>$body<br><br>\n"; > > > } > > > > > > Thanks, > > > > > > Dan > > > > > > > > > -- > > > 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 > > > > > > > > -- > Dan Fitzpatrick > Rapid Ascent - the e-business builders > http://www.rapidascent.com > mailto:dan@rapidascent.com > tel 949-252-2600 > fax 949-252-2601 > > >

« previous php.db (#1024) next »