Menu

Add Topic

Forum

waiting answer September 24, 2020

I found a error in my php mysql query. Please give me a solution.

if(isset($_POST['submit'])){
    $search_data = $_POST['search_data'];
}
$query = "SELECT * FROM answers WHERE tags LIKE '%$search_data%' ";

Notice: Undefined variable: search_data in C:\xampp\htdocs\billing\users\menu.php on line 20

Pls add your solutions in the comments

Answers
September 24, 2020

Pls replace the code like this,

if(isset($_POST['submit'])){
    $search_data = $_POST['search_data'];
    $query = "SELECT * FROM answers WHERE tags LIKE '%$search_data%' ";
}

 

0 0

Please Login to Post the answer

Leave an Answer