skattabrain Posted May 21, 2007 Share Posted May 21, 2007 long time lurker, first time post. this is weird and i appreciate any help or insight on this one. i query my 'parts' database for part numbers ... works great, pretty simple stuff. however, if i use 'max' in my select statement as a search criteria (not as a command) it hangs my server. also, "mx" hangs it as well, and the letter "h" ... i'm sure there are more, but I'm just slot as to what's going on here. here is my query ... $searchthis = $_GET['pn']."%"; $sql = "SELECT * FROM parts, inventory WHERE PartNumber LIKE '".$searchthis."' and inventory.partID = parts.partID"; if use ?pn=CV12 as the variable, works fine ... returns the results. if i use ?pn=MAX or ?pn=MX ... it just hangs and makes the server unresponsive. it's a brand new redhat server. funny thing is, on my windows dev box i have apache/mysql set up and this query causes no problems. i'm lost on this ... am i enclosing the criteria correctly? if i echo $sql into the page, the query looks normal - SELECT * FROM parts, inventory WHERE PartNumber LIKE 'CV12%' and inventory.partID = parts.partID any ideas? is the server set up wrong? i'm lost on this one. Quote Link to comment https://forums.phpfreaks.com/topic/52400-mysql-query-max-used-as-search-criteria-hangs-the-server-not-max-the-command/ Share on other sites More sharing options...
btherl Posted May 22, 2007 Share Posted May 22, 2007 What happens when you run the query manually, such as in phpmyadmin? Also are you sure the hang happens during query execution? Try adding "exit(0);" immediately before the query and run the script, then move it immediately after the query and run the script again. Is your database identical (including indexes) on your dev box and on the live server? Quote Link to comment https://forums.phpfreaks.com/topic/52400-mysql-query-max-used-as-search-criteria-hangs-the-server-not-max-the-command/#findComment-258684 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.