I do have table table1 with two columns say name and details when I search by details there were multiple name listing. I want to retrieve that name lis开发者_开发百科t and display to a webpage using PHP. how can I do that?
the most basic page.php:
<?php
$sql = mysql_query('SELECT name FROM table1 WHERE details = "something"');
$result = array();
while($row = mysql_fetch_assoc($sql)){
array_push($result,$row['name']);
echo $row['name'].'<br />';
}
print_r($result);
加载中,请稍侯......
精彩评论