mysql 中select * from my_user where id>0和select * from my_user;有什么区别?

mysql 中select * from my_user where id>0和select * from my_user;有什么区别?,第1张

select * from my_user where id>0查询所有id大于0的数据,(有条件查询),select * from my_user查询表中所有数据(无条件查询)

$query = "INSERT INTO news txt(theme,text,date)"

."VALUES('$theme','$text','$date')"

$query = "INSERT INTO news picture(theme,link,date)"

."VALUES('$ptheme','$plink','$pdate')"

sql语句错了

news txt 这个应该是 news_txt吧

news picture也应该是news_picture

除此之外 values前面要加空格,合理的是

$query = "INSERT INTO news txt(theme,text,date)"

." VALUES('$theme','$text','$date')"

$query = "INSERT INTO news picture(theme,link,date)"

." VALUES('$ptheme','$plink','$pdate')"

另外:

$result = mysql_query($query)这样只能插入news_picture的那个表。news_txt无法插入了

改为

$query = "INSERT INTO news txt(theme,text,date)"

." VALUES('$theme','$text','$date')"

$query1 = "INSERT INTO news picture(theme,link,date)"

." VALUES('$ptheme','$plink','$pdate')"

$result = mysql_query($query)

$result1= mysql_query($query1)


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/6099336.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-14
下一篇 2023-03-14

发表评论

登录后才能评论

评论列表(0条)

保存