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

Why php is sometimes called as embedded scripting language?

0 Answers  


How do you find the length of a string in php?

0 Answers  


Can we extend final class in php?

0 Answers  


What is pdo classes?

0 Answers  


What is the difference between include and include_once ? Which is one is good in terms of performance ?

2 Answers   Dest,






List out different arguments in PHP header function?

4 Answers  


Is php a dying language?

0 Answers  


Give the case where we can use get and we can use post methods?

0 Answers  


Is php a mvc?

0 Answers  


Why php script is not running in browser?

0 Answers  


Use of Session

6 Answers  


What are magic methods?

0 Answers  


Categories