[SOLVED] problem in fetching record

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

[SOLVED] problem in fetching record

Post by itsmani1 »

i used

Code: Select all

$Res = mysql_query("select ImageId, ImageName, ImageAlt from Images") or die(mysql_error());
$signsNumber = mysql_num_rows($Res);
and found 5 recods.
now i want to access record number 0 and record num 3 from the above 5 records.

howz this possible?

Thanx.
M. Abdul Mannan.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

mysql_data_seek

Code: Select all

mysql_data_seek($result, 0);
// ...
mysql_data_seek($result, 3);
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

Res = mysql_query("select ImageId, ImageName, ImageAlt from Images") or die(mysql_error());

but where is the field name that i will fetch like i want to fetch "ImageName"
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

data_seek merely jumps the internal pointers to where you ask it. You'd simply use a mysql_fetch_* function..
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

okies thans its been solved ....
Post Reply