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

How do you parse and process html/xml in php?

0 Answers  


What is rest api in php?

0 Answers  


How can we determine whether a variable is set?

0 Answers  


Write a php script to get the largest key in an array?

0 Answers  


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

1 Answers   Wipro,


What is alias in php?

0 Answers  


Write the code for upload a video file in PHP.How will You Play this in Your Page.?

2 Answers   ASD Lab, Convex Digital,


How to create an array from php string?

0 Answers  


Explain me what is the difference between $_files['userfile']['name'] and $_files['userfile']['tmp_name']?

0 Answers  


How can I find what type of images that the PHP version supports?

1 Answers  


Is variable name casesensitive in php?

0 Answers  


How to download files from an external server with code in php?

0 Answers  


Categories