警告:使用未定义的常量search_query - 在第721行的C:\ xampp \\\\\\\ [英] Warning: use of undefined constant search_query - assumed 'search_query' (this will throw an error in a future version of PHP) in C:\xampp\htdocs\CMS\all_post.php on line 721
本文介绍了警告:使用未定义的常量search_query - 在第721行的C:\ xampp \\\\\\\的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello all
我尝试在我的帖子页面上创建搜索引擎,但是此消息显示在页面上(
警告:使用未定义的常量search_query - 假设'search_query '(这将在未来的PHP版本中引发错误)在第721行的C:\ xampp \\\ htdocs \ CMS \ All_post.php中)在echoSome RESULT中;我试着打印一些东西但是也没有工作
我尝试了什么:
Hello all
I am try to make search engine on my post page but this message show on page (
Warning: Use of undefined constant search_query - assumed 'search_query' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\CMS\All_post.php on line 721) in echo "Some RESULT"; i am try to print something but not work also
What I have tried:
<?php
if(isset($_POST['submit'])) {
$search = $_POST['search'];
$query = "SELECT * FROM posts WHERE post_title LIKE '%$search%' ";
$query_search = mysqli_query($connection,$query);
}
// if(!query_search) {
// die("QUERY FAILED" . mysqli_error($connection));
// }
// $count = mysqli_num_rows($query_search);
// if($count == 0){
// echo "<h1> no result</h1>";
//
// }else {
//
// echo "Some RESULT";
// }
// }
?>
推荐答案
_POST ['submit'])){
_POST['submit'])) {
search =
_POST ['search'];
_POST['search'];
这篇关于警告:使用未定义的常量search_query - 在第721行的C:\ xampp \\\\\\\的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文