我实际上想使用PHP uniqid()函数生成随机密码
$randomPassword = uniqid();
但这样做会给我一个错误: -
Unknown column '4f74456589d51' in 'field list'
是什么原因?
我在数据库中插入此值: -
$SQL = sprintf("INSERT INTO cust (password) VALUES (%s)", myFunction($randomPassword, "text"));
答案 0 :(得分:2)
$SQL = sprintf("INSERT INTO cust (password) VALUES ('%s')", GetSQLValueString($randomPassword, "text"));
答案 1 :(得分:0)
$SQL = sprintf("INSERT INTO cust (password) VALUES ('%s')", myFunction($randomPassword, "text"));
你忘记了''围绕%s