开发者

converting mysql data into array?

开发者 https://www.devze.com 2022-12-28 23:29 出处:网络
i have an ajax script that check if the user name is available or not, but it keeps taking the newest user name and the rest are out

i have an ajax script that check if the user name is available or not, but it keeps taking the newest user name and the rest are out

$result = mysql_que开发者_如何转开发ry("Select username from customer");

while ($row = mysql_fetch_array($result)){

$existing_users=array(''.$row['username'].',');     
}

i know i am doing something worng


$result = mysql_query("select username from customer");

$existing_users = array();

while ($row = mysql_fetch_array($result)){  
   $existing_users[] = $row[ 'username' ];
}

$csv_array = implode( ',', $existing_users );
0

精彩评论

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

关注公众号