Hi, I just uploaded 9 million records to a mysql table. The table consists of an id, a name, and a numeric value. The way its supposed to work is that the user passes the name to php and php returns the numeric value. However, either mysql or php is timing out -- I think. Here's what I've got so far:
When the query is called and times out, mysql still returns an empty row. Is there anyway to optimize the query or anything else I can do to retrieve the records? Thanks in advanced!
Code:
$query = "SELECT `value` FROM `table` WHERE `name` = '$q' LIMIT 1"; $result = mysql_query($query) or die(mysql_error()); mysql_close($dbhandle); if($result) { if(!$row = mysql_fetch_array($result)) { //STILL SHOWS UP HERE //no value } else { //value } } else { //no value }
Comment