![](/img/trans.png)
[英]I want to send data into many Table from one FORM but my selected table not others
[英]i want select name form one table and display in my page
SELECT name from tbl_gallery, tbl_gallery_category where 'name' = 'gallery-cat-id';
我有two tables
一个用于category
, second
用于saving images
具有类别名称的saving images
,我的查询在这里,然后执行thien显示MySQ
L返回了一个空结果集(即零行)。 (查询花费了0.0007秒。)
使用单引号,双引号和反引号时,请删除名称中的单引号,而不是“名称”
如果将单引号放在表名或列名上,它们将被视为字符串,因此请勿放置。
SELECT `name`
FROM tbl_gallery
JOIN tbl_gallery_category ON tbl_gallery.name = tbl_gallery_category.gallery-cat-id;
注意 :
where 'name' = 'gallery-cat-id';
以上条件始终始终为假。 因为您刚刚比较的“名称”等于“ gallery-cat-id”,所以它是false。
不要在表名或列名上使用引号。
SELECT name
from tbl_gallery
join tbl_gallery_category on tbl_gallery.name = tbl_gallery_category.`gallery-cat-id`
如果需要转义列名,请使用反引号。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.