最新回答 / 慕粉2058116677
如果你的项目对数据库类型没太大的要求,只用mysql的话,之前你又数据mysql的写法,可以使用mysqli扩展,面向对象和面向过程两种写法都可以。如果你的项目要兼容多个不同类型的数据库的话,建议使用pdo,扩展性好,两者的性能都差不多。主要看你的用途
2017-04-08
最新回答 / Soulans
完整的看就不一样了。当键入为【liu】时:select * from user where uername = 'liu' and password ='liu123';当键入为【' or 1=1 #】时:select * from user where username = '' or 1=1 # and password = ; 这时,or 1=1 使得查询成立。当quote后【\' or 1=1 #\'】:select * from user where username = '\' or 1=1 ...
2017-04-08
最新回答 / 我是新手_请多指教
我才刚学不久,我想应该是前面dbname=article库没选错的话,那么SELECT * from article中article不能写数据库,应该改为article库下的某张数据表
2017-03-27
最新回答 / 妄想翻身的咸鱼
因为在下面new PDO的时候第四个参数,如果你new的时候传了前面三个,不传第四个,那就不存在这个变量,就会报错,所以这样写的作用就是你不传第四个参数的时候就把它设为空,这个变量就存在了就不会报错了
2017-02-21
最新回答 / 杰or毅
mysql:host:localhost;dbname=books','root'host后 : 改 = mysql:host=localhost;dbname=books','root'
2017-02-08
已采纳回答 / 風水
因为当运算符,函数或流程控制需要一个 integer 参数时,值会自动转换。$id 会被转换成integer类型