As dumb as it sounds, is there a way to do something like this:
select row_id from mytable where * like '%searched_text%';
By * here I mean "all the fields" in the table, instead of me specifying them one by one...
Search for data in databases, schemes, and separate tablesRight-click the selection and select Tools | Full-Text Search. Alternatively, press Ctrl+Alt+Shift+F . In the search field of the Full-text Search dialog, type your search request and click Search.
Find data across a MySQL connection by using the text search feature on any number of tables and schemas. From the schema tree, select the tables, schemas, or both to search and then right-click the highlighted items and click Search Data Table from the context menu.
To select multiple columns from a table, simply separate the column names with commas! For example, this query selects two columns, name and birthdate , from the people table: SELECT name, birthdate FROM people; Sometimes, you may want to select all columns from a table.
It is not possible with one query.
However when you do:
DESCRIBE table_name;
you get the field names which you can generate the query from.
Search in all fields from every table of a MySQL database May be useful.
Here's a solution combined with some PHP to search all fields in a specific table.
include("db_con.php");
//search all fields
$searchphrase = "banan";
$table = "apa303";
$sql_search = "select * from ".$table." where ";
$sql_search_fields = Array();
$sql = "SHOW COLUMNS FROM ".$table;
$rs = mysql_query($sql);
while($r = mysql_fetch_array($rs)){
$colum = $r[0];
$sql_search_fields[] = $colum." like('%".$searchphrase."%')";
}
$sql_search .= implode(" OR ", $sql_search_fields);
$rs2 = mysql_query($sql_search);
$out = mysql_num_rows($rs2)."\n";
echo "Number of search hits in $table " . $out;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With