php - Retrieving a column from mySQL database and passing to array -


i have constructed array manually, e.g.:

<?php $noupload = array('nick', 'cliff'); ?> 

but trying populate array automatically users in mysql database. far have this:

<?php // make mysql connection $debug=false; $conn = mysql_connect("host","user","password"); // mysql connection data $db = mysql_select_db("database");  $query = "select * users access '%listen%'";   $result = mysql_query($query) or die(mysql_error());  while($row = mysql_fetch_array($result)){     $listen = "'". $row['login']. "', "; } ?> 

$listen constructs user list in way entered manually (i tested using echo), not sure how pass $noupload. tried:

$noupload = array($listen);

but didn't work. think i'm close , grateful on final hurdle,

thanks,

nick

you can declare $listen array

$listen = array(); while ($row = mysql_fetch_array($result)) {     $listen[] = "'". $row['login']. "'"; } 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -