0
我有這樣的代碼連接到MySQL,並從一個表中獲取數據:MySQL數據,形成用PHP
<?php
//Include database connection details
require_once('sql/config.php');
//Connect to mysql server
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
die('Failed to connect to server: ' . mysql_error());
}
//Select database
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
die("Unable to select database");
}
$result = mysql_query("SELECT * FROM customers");
while($row = mysql_fetch_array($result)) {
echo $row['email'];
echo "<br />";
}
mysql_close($link);
?>
現在,我怎麼填這個電子郵件數據從MySQL到這是創建以前安全的形式?
我不明白你的問題... – Marco 2012-04-12 13:11:46
你的代碼似乎沒問題。你想完全填寫什麼?更好地解釋 – ShinTakezou 2012-04-12 13:12:25
我想將id row ['email']放在ID爲 – 2012-04-12 13:20:03