Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
restart fetching array
Old 08-12-2009, 03:04 AM restart fetching array
Skilled Talker

Posts: 97
Trades: 0
now i'm using the function mysql_fetch_array to start fetching all that i need is to fetch the array again in the same page.. and i dont want to repeat the function mysql_fetch_array ..
i mean that it exists a fuction to repeat the fecthing from the begining again..but i dont know it..
can anyone help me??
john_zakaria is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-12-2009, 04:06 AM Re: restart fetching array
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
No, if you want to recreate the array, you need to call back mysql_fetch_array().
There is no "rewind" on it.
But I don't see why you don't want to call it again.
The query have already be executed by the server, and you don't re-execute it by calling fetch_array again.
You just read the result of the query a 2nd time.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 08-12-2009, 09:39 PM Re: restart fetching array
NullPointer's Avatar
Will Code for Food

Posts: 2,781
Name: Matt
Location: Irvine, CA
Trades: 0
Like tripy said, you'll have to recall the function. You may have to reset the internal pointer in the result as well:

PHP Code:
mysql_data_seek($result0); 
This way when you recall the function it will begin fetching from the beginning of the result.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 08-15-2009, 03:55 PM Re: restart fetching array
Super Talker

Posts: 100
Trades: 0
I think you need to use mysql_data_seek and mysql_fetch_assoc functions trickly to acheive your goal.
__________________

Please login or register to view this content. Registration is FREE

ASP.NET 3.5 | SQL 2005 Database | US Based Hosting Company | 24 X 7 Support | Daily Backups | Uptime Guarantee | Affiliates - $50 Per Sale
|
Please login or register to view this content. Registration is FREE
twhdir is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to restart fetching array
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13667 seconds with 12 queries