生锈,只是试图通过参数传递东西。我究竟做错了什么?
//Insert into DB
function insert(x,y,z)
mysql_query("INSERT INTO x (y)
VALUES ('z')");
insert("test","name","Tyler");
function insert($x,$y,$z){
mysql_query("INSERT INTO ".$x." (".$y.") VALUES ('".$z."')");
}
insert("test","name","Tyler");
确保您通过以下方式正确引用变量$
:
//Insert into DB
function insert($x, $y, $z)
{
mysql_query("INSERT INTO $x ($y) VALUES ('$z')");
}
insert("test","name","Tyler");