1
我正在创建一个非常小的数据库抽象层,我想发送一个从表单获得的变量数组,并生成一个更新sql语句,并最终执行它。 我在下面的第二行最后一行放什么?例如, 。从表单值生成php mysql更新表达式
$table name = "user";
$username = $_post['username'];
$password = $_post['password'];
$email = $_post['email'];
$array = (username=>$username, password=>$password, email=>$email);
$query = "update $this->tableName".
$query = """" The value from the assc array in the form of database value='form value'
$query = "WHERE condition";
非常感谢它的工作原理 – 2010-02-03 08:51:28
我考虑将其作为多维数组发送,例如 $ multi = array(); $ multi [] = array($ customer_id,$ domain_name,$ purchase_date, $ expiry_date,$ vendor); $ multi [] = array(“c_id”,“domain_id”,“purchase_date”, “expiry_date”,“vendor”); 你怎么能实现这种数组的foreach? – 2010-02-06 15:03:44