Click to See Complete Forum and Search --> : how do i get the content out of arrays?


demiurgen
04-30-2006, 09:29 AM
<?php
$connection = mysql_connect("localhost", "root", "********");
mysql_select_db("DB");
$result = mysql_query("SELECT text, price FROM product");
while ($row = mysql_fetch_array($result) ) {
$text01 = $row['text'];
}
echo "$text01";
?>

how do get the rest of the array out???
the table called product has 16 rows of content divided into 2 columns called text and price.
how can i get out the content of the text on row 7??
the code above only outputs the last entry in the db...

NogDog
04-30-2006, 10:11 AM
Put the echo inside of the while loop if you want to see all the rows.

demiurgen
05-01-2006, 05:02 AM
that worked!

but i dont want it all out in the same place...

how can i get out just the content of row 7???

sridhar_423
05-01-2006, 05:13 AM
SELECT text, price FROM product where rownum<=7 minus SELECT text, price FROM product where rownum<=6

this will retrieve only 7 row.