Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
Have never used this syntax before but i have the following
$result = mysql_query("SELECT * FROM phpbb_smilies");
$smilies=mysql_fetch_array($result);
echo $smilies['smile_url'];
which outputs the first record of that table fine.
What i want to do is output the record of a certain row, say for instance i wanted the 'smile_url' of row 5
any ideas?
|
AndyKent
Member
Registered: 3rd Sep 05
User status: Offline
|
I usually do
mysql_fetch_array($query, MYSQL_ASSOC);
I then usually do a while loop do get to the right number.
You could do a while loop that loops around the number of rows you are after. So for the 5th smilie you'd loop 5 times then print.
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
SELECT * FROM phpbb_smilies LIMIT 5,1
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
as ian said above or if the rows have a auto_increase number, you could use that in the query, ie "SELECT * FROM table WHERE uid=12345" etc
|
Paul_J
Member
Registered: 6th Jun 02
Location: London
User status: Offline
|
use PL SQL and a cursor.
|