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?

Answers were Sorted based on User's Feedback



i want to store retrieved data from database into an array list with limit.And display the data fro..

Answer / 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

i want to store retrieved data from database into an array list with limit.And display the data fro..

Answer / bibhu

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 ?    8 Yes 5 No

Post New Answer

More PHP Interview Questions

Which php framework is in demand?

0 Answers  


Is php a case sensitive language?

0 Answers  


Why do we use namespace in php?

0 Answers  


What is a php array?

0 Answers  


Difference between mysql_connect and mysql_pconnect?

0 Answers  






How to get the value of current session id?

0 Answers  


How many types of inheritances used in php and how we achieve it.

0 Answers  


Is laravel better than codeigniter?

0 Answers  


How would you declare a function that receives one parameter name hello?

0 Answers  


how to display and include the user system date/time in a php program/project

1 Answers   Wipro,


What does trim () do in javascript?

0 Answers  


hi, i have knowledge about PHP/MYSQL,i am fresher M.Sc-IT 2009 pass out,any recruitment in PHP please let me know.

0 Answers  


Categories