2015-10-06 76 views

回答

0

你需要在使用foreach循环之前用数据初始化一个数组。

应使用以下格式:

//Obtain values from form text boxes 
$name = $_POST['Name'] //This must match the name input on your form 

//Populate values into array 
$arrayData = array('$name'); //Can also populate with multiple values.. 

//Query 
foreach ($arrayData as $value) { 
    $sql = "INSERT into table_name (table_column_name) VALUES($value)"; 
} 

来源:http://www.w3schools.com/sql/sql_insert.asp

http://bbrown.kennesaw.edu/papers/php2.html

相关问题