1,105,375 Community Members

while($row = mysql_fetch_assoc($result))

Member Avatar
R0bb0b
Posting Shark
995 posts since Jun 2008
Reputation Points: 344 [?]
Q&As Helped to Solve: 92 [?]
Skill Endorsements: 3 [?]
 
0
 

I use to use all for loops for looping through database data sets and just started using while loops with mysql_fetch_ type functions and for some reason, the second mysql_fetch loop in the file never seems to fire but does when I switch the second one to a for loop. Does anyone know a reason for this? Is there some type of array pointer that I need to reset or something?

Member Avatar
R0bb0b
Posting Shark
995 posts since Jun 2008
Reputation Points: 344 [?]
Q&As Helped to Solve: 92 [?]
Skill Endorsements: 3 [?]
 
0
 

actually, I mostly work with postgres so it is usually pg_fetch_assoc, which should be the same thing anyway.

Member Avatar
R0bb0b
Posting Shark
995 posts since Jun 2008
Reputation Points: 344 [?]
Q&As Helped to Solve: 92 [?]
Skill Endorsements: 3 [?]
 
0
 

I found it. The function I need to use is mysql_data_seek() for mysql. I cannot find an equivalent for postgres like pg_data_seek(). Anybody have any ideas what I would use for postgres?

Member Avatar
nikesh.yadav
Posting Whiz in Training
220 posts since Feb 2008
Reputation Points: 4 [?]
Q&As Helped to Solve: 21 [?]
Skill Endorsements: 0 [?]
 
0
 

if u r looking for mysql_data_seek()

try http://www.w3schools.com/php/func_mysql_data_seek.asp

and

http://in2.php.net/mysql_data_seek

i think these give u basic knowledge

Member Avatar
R0bb0b
Posting Shark
995 posts since Jun 2008
Reputation Points: 344 [?]
Q&As Helped to Solve: 92 [?]
Skill Endorsements: 3 [?]
 
0
 

if u r looking for mysql_data_seek()

try http://www.w3schools.com/php/func_mysql_data_seek.asp

and

http://in2.php.net/mysql_data_seek

i think these give u basic knowledge

No, I found that one, I am looking for an equivalent for postgres.

Member Avatar
R0bb0b
Posting Shark
995 posts since Jun 2008
Reputation Points: 344 [?]
Q&As Helped to Solve: 92 [?]
Skill Endorsements: 3 [?]
 
0
 

Just bringing back to the top to see if anybody can shed some light here.

Member Avatar
R0bb0b
Posting Shark
995 posts since Jun 2008
Reputation Points: 344 [?]
Q&As Helped to Solve: 92 [?]
Skill Endorsements: 3 [?]
 
0
 

I found it, actually got it from phpfreaks. surprisingly got the answer within 10 minutes of posting. There are a lot of good php users there but its so dry though. I much prefer daniweb. Anyway the function is pg_result_seek().

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article