I can not search on multiple fields on php. Conditions of AND and OR are not working in three fields.
Example:
$string_query = mysql_query ("SELECT * FROM Rock WHERE author ="."'".htmlspecialchars($_POST['search'])."' AND name ="."'".htmlspecialchars($_POST['name'])."' OR god="."'".htmlspecialchars($_POST['god'])."' ");
If you fill only the $_POST['search'] and $_POST['name'], the search is successful, but if $_POST['search'], $_POST['name'] and $_POST['god'] is not working. How to be?
htmlspecialchars. Usemysqli_real_escape_string. (Don't use the oldmysqlextension; it is so deprecated that it is already removed from PHP.)