开发者

How do I capture search index in MySQL using PHP?

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜