i want to store retrieved data from database into an array
list with limit.And display the data from that array
list.have any answer for this?

Answer Posted / guest

First retrieve data from database using following command

$select = mysql_query("SELECT * FROM table limit number") or
die(mysql_error);

then store retrieve data in array using following command

while($row = mysql_fetch_array($select))
{
$rname[] = $row['name'];
}

display values of array

foreach($rname as $val)
{
echo $val;
}

Is This Answer Correct ?    15 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to set a value in session? How to remove data from a session?

496


How can you make a connection with mysql server using php?

507


Why is php used?

562


Explain how we can retrieve the data in the result set of mysql using php?

500


Suppose the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?

536






What is instantiation?

1738


Is php free to use?

533


What is rtrim php?

543


Can we use session in mvc?

553


How can I make a script that can be bilingual (supports english, german)?

584


What are the differences between GET and POST methods?

530


What is cURL in PHP?

546


What is isset in php form?

533


Explain me what is x+ mode in fopen() used for?

539


Explain NULL?

573