Mysql_fetch_array () function is always running unsuccessfully, ask for answers
Include ('.. /webshop_sql_con.php ');
if (isset ($_get[' search ')) {
$search =$_get[' search ';
$query = "SELECT * from Obj_info WHERE obj_name like '%search% ' ORDER by Obj_sale DESC";
if ($result =mysql_query ($query, $dbc)) {
while ($row =mysql_fetch_array ($result)) {
Print
'. $row [' Obj_name ']. '
Price: '. $row [' Obj_pri ']. '
< li="">';
}
}
Database connection file has been written, the other search is the result of this write can be returned, this is always wrong, and I tried Var_dump ($row), the result is false. What do you mean?
In the graduation design, PHP is also just contact, trouble mobile sister advice AH
------Solution--------------------
There are no records in the table that contain search words
Maybe what you need is
$query = "SELECT * from Obj_info WHERE obj_name like '%$search% ' ORDER by Obj_sale DESC";
------Solution--------------------
Same as 2 floor $query = "SELECT * from Obj_info WHERE obj_name like '%$search% ' ORDER by Obj_sale DESC";
Be careful.
------Solution--------------------
Agree to 2 floor, the stitching statement to be careful AH
------Solution--------------------
SQL is incorrectly written.