我想要做的是: 我有一個名爲Stations的表,它有100列。我想從工作站中選擇所有記錄並隨機選擇1條記錄並回顯隨機記錄。回聲mysql查詢使用PHP
這是我到目前爲止有:
<?PHP
$connect = mysql_connect("***", "****", "****") or die("Connection Failed");
mysql_select_db("***");
$query = mysql_query("SELECT * FROM Stations ORDER BY RAND() LIMIT 1");
WHILE($rows = mysql_fetch_array($query)):
$Station = $rows['Station1'];///seems it will only show Station1 Column I have Station1 to Station100 was not sure how to add rest of Stations
endwhile;
?>
很酷,現在你的問題是什麼?移動到PDO,**停止使用'mysql_ *',它被棄用和不安全!** –