$query = "INSERT INTO add (`datetime`,`category`,`subcategory`,`selectapet`,`breed`,`title`,`description`,`inthisad`,`sizeatmaturity`,`age`,`gender`,`fprice`,`tprice`,`picture`,`email`,`name`,`mobile`,`phone`,`address`,`city`,`state`,`country`) VALUES (NOW(),'$category', '$subcategory', '$selectapet','$breed','$title','$description','$inthisad','$sizeatmaturity','$age','$gender','$fromprice','$toprice','$picture','$email','$name','$mobile','$phone','$address','$city','$state','$country')";
$result=mysqli_query($dbc, $query) or die("error when query run") ;
Error is “error when query run” is what i m getting have provided all input. datetime is CURRENT_TIMESTAMP and i m using NOW() for it
ADD (your table name) is a reserved word and should be backticked with ` in the same way as your column names