Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old May 8th, 2003, 07:49 AM
Smoker Smoker is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 14 Smoker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
is a result pointer an object?

I want to set back the internal result pointer from a mysql_query by one. I looked at the code behind mysql_data_seek and it seems that when you do a select in a mysql_query it returns a linked list of some sort. when you call mysql_data_seek it traverses the linked list x times where x is the specified offset. Does anyone know how this is set up. I just want to move the pointer backwards one.
The code i tried was
$result = mysql_query('SELECT * ...');
mysql_fetch_row($result);
$result->data_cursor = $result_array->data->data->prev;
$result_array->current_row = 0;

This doesnt work but, this is similar to how mysql_data_seek works.

---Moved From PHP To Database help by Postalcow---

Reply With Quote
  #2  
Old May 8th, 2003, 01:05 PM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: is a result pointer an object?

I don't think you can go back in PHP. But why not store the data in an array, and then you can access it in whatever way you want?
php Code:
Original - php Code
  1.  
  2. $result=mysql_query("SELECT ...");
  3. $resultset=array();
  4. while ($line=mysql_fetch_array($result))
  5.     $resultset[]=$line;
  6.  
  7. echo $resultset[5]["somefield"]."<br>";
  8. echo $resultset[2]["someotherfield"]."<br>";
  9. echo "There are ".sizeof($resultset)." rows";

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > is a result pointer an object?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway