I was working with a database in MySQL, where I have a table say ABC.
I want to query the database for a given search keyword, and display the output in a table. When I am querying with the following code, it is working fine:(Games Played 1 is a column name)
if($_POST['searchby'] == "Games Type"){
$query_Recordset1 = "SELECT * FROM users_entity WHERE `Games Played 1' LIKE '%".$searchword."%'";
However, when I am trying to check whether the keyword is present in two columns, Games Played 1 or Games Played 2, it is not working. I am using the following code for that.
if($_POST['searchby'] == "Games Type"){
$query_Recordset1 = "SELECT * FROM elgg_users_entity WHERE `Games Played 1` OR `Games Played 2` LIKE '%".$searchword."%'";
Can anyone suggest where I am doing wrong?? Also, when I run the webpage with the above code, it gives a warning as "The MySQL server has gone away"