简体   繁体   English

为图像“标记”搜索功能运行 SQL

[英]Run SQL for image “tagging” search function

I am trying to get my code to run a search function which in theory runs a search for image "tagging" I have created my databases and the connection works fine.我试图让我的代码运行一个搜索功能,该功能理论上运行搜索图像“标记”我已经创建了我的数据库并且连接工作正常。 I have also set up 3 tables one for each part that plays for this "tag image search" to work.我还为每个播放此“标签图像搜索”的部分设置了 3 个表。 It is just when running the program and executing the code that it does not work and comes up with the following error message:只是在运行程序并执行代码时,它不起作用并出现以下错误消息:

Notice: Undefined variable: searchesvale in C:\xampp\htdocs\galleryViewer\searchingtags.php on line 33

The code can be shown below with the "SQL Select statement" which is trying to run so when searching for a "particular image tag" this image will be retrieved from the gallery based on the "tag keyword search".下面的代码可以显示为“SQL Select 语句”,该语句试图运行,因此在搜索“特定图像标签”时,将根据“标签关键字搜索”从图库中检索该图像。

   $searchvalueentered = $_POST['searchvalue'];
$sql = "SELECT pictures.idpic, pictures.name, pictures.info, pictag.tagpicID, pictag.pictagName, tagging.IDimage, tagging.tagpicID FROM pictures, pictag, tagging WHERE pictures.idpic = '$searchvalue' AND pictag.tagpicID= '$searchvalue' AND tagging.tagpicID= '$searchvalue'";
$sql = "SELECT pictures.idpic, pictures.name, pictures.info, pictag.tagpicID, pictag.pictagName, tagging.IDimage, tagging.tagpicID FROM pictures, pictag, tagging WHERE pictures.idpic = '**$searchvalue**' AND pictag.tagpicID= '**$searchvalue**' AND tagging.tagpicID= '**$searchvalue**'";

Scroll to the right and I highlighted the variable $searchvalue .向右滚动,我突出显示了变量$searchvalue This error says that this variable is not defined.此错误表示未定义此变量。 You have the variable $searchvalueentered defined, and $_POST['searchvalue'] , but NOT $searchvalue .您定义了变量$searchvalueentered$_POST['searchvalue'] ,但不是$searchvalue

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM