how to get array format from mysql result with php -


i want array format mysql database. example,let have name table.

name table

id    name  1    jone 2    smith 3   waiyan 

i want data array form.

$name=array('jone','smith','waiyan');(//i want format) 

how can result? beginner php.please answer me.thank contribute. sorry english.

something this:

$sth = mysql_query("select name your_table"); $rows = array(); while($r = mysql_fetch_assoc($sth)) {     $rows[] = $r["name"];     //or     array_push($rows, $r['name']); } print_r($rows); 

see: mysql php


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -