I'm just wondering if anybody already has this done.. Basically it should check all find all the fields in a table for LIKE %...% To do this it needs to detect each of the fields then make a mysql query with a bunch of 'OR's.. Anyhow greens to anybody who pastes it in here..
Try this $conn = @mysql_connect( 'localhost',$uname ,$pass) or die( mysql_errno().': '.mysql_error().NL ); $db=mysql_select_db($db,$conn); $result = mysql_query("SHOW COLUMNS FROM $table"); if (mysql_num_rows($result) > 0) { $i=0; while ($row = mysql_fetch_array($result)) { if($i==0) { $q="select * from $table where ".$row[0]."=".$condition; } else { $q.=" or ".$row[0]."=".$condition; } $i++; } } echo $q; PHP: