我的问题是我是否正确使用%s或者是否必须为我的变量使用其他内容? (我的数据库中没有添加任何记录)
参赛作品:
$login = "coolkidz";
$sname = "heyu";
$city = "beautiful";
$pass = "awesome";
$username = "what";
$mcode = "nice";
查询
mysql_query("INSERT INTO login(sname, city, pass, username, mcode, username) VALUES('%s','%s','%s','%s','%s','%s')", $sname, $city, $pass, $username, $mcode, $login);
这是不发光的回声
echo "'INSERT INTO login(sname, city, pass, username, mcode, username) VALUES('%s','%s','%s','%s','%s','%s')', $sname, $city, $pass, $username, $mcode, $login");
答案 0 :(得分:1)
更改为:
mysql_query("INSERT INTO login(sname, city, pass, username, mcode, username) VALUES('$sname','$city','$pass','$username','$mcode','$login')");