b3ta.com board
You are not logged in. Login or Signup
Home » Messageboard » XXX » Message 3384004 (Thread)

# I think it looks good.
THREADJACK!
Anyone here know much about php?
I need to ask something that I can't figure out.
(, Mon 28 Jun 2004, 0:16, archived)
# sprinkles
does i think - thats what he did his swear thing in
(, Mon 28 Jun 2004, 0:18, archived)
# Vot is it that it is
that you vant to know?
(, Mon 28 Jun 2004, 0:23, archived)
# i'm crap at explaining, but I'll try my best
I'm pulling a bunch of results out of a database, and using "mysql_fetch_array" to get an array out of them.
I want to know how to start at, say, the 10th row/array in the result set, rather than starting at the first one.


That make sense?
(, Mon 28 Jun 2004, 0:28, archived)
# You could try
$query = "SELECT * FROM ????;";
$result = mysql_query($query,$myDB);
while($row = mysql_fetch_array($result,10))


Where ???? is your array
(, Mon 28 Jun 2004, 0:37, archived)
# ahhh, i didn't know you could specify which row thing in teh fetch array bit
I was just looking in the online php manual thing at "mysql_data_seek" and trying to work that out.

But if that'll work, bargin!
Thanks
(, Mon 28 Jun 2004, 0:40, archived)
# I'm not very sure about
mysql, but could you not use mysql_data_seek to move the pointer to the row, and then mysql_fetch_row() / mysql_fetch_array.
(, Mon 28 Jun 2004, 0:37, archived)
# I was just looking at the data seek thing
i'll give that a try too if the other two ideas here dont work.
(, Mon 28 Jun 2004, 0:42, archived)
# select them from the db, using
LIMIT in the mysql-query. e.g.: SELECT * FROM table LIMIT 9,5 for selecting rows 10-15.

dev.mysql.com/doc/mysql/en/SELECT.html and search for LIMIT.
(, Mon 28 Jun 2004, 0:40, archived)
# oh, that looks interesting
this could be helpful too.
Thanks.
(, Mon 28 Jun 2004, 0:42, archived)
# That looks like it'll do the job nicely
thanks all 3 for your help.
(, Mon 28 Jun 2004, 0:51, archived)
# What do you need to know?
I code PHP every day.
(, Mon 28 Jun 2004, 0:24, archived)