I have a query that fails every 5th or 6th time. I am developing a script to grab form data and plug into a mysql. This query grabs the last projectID. It is embeded in a function.My DB connects fine and there is dummy info in the DB . detail is the table that houses projectID.
there is a lot more to the script but I have narrowed it down to this query.
thanks for any advice!
matt
-----> begin function definitions <--------
function get_last_ID(){
pull last projectID from project.details
$query = "select * from detail order by projectID desc limit 1";
$projectID_result = mysql_query($query);
punch last key ID into variable $currentID
if ($projectID_result){
$row = mysql_fetch_array($projectID_result);
$currentID = $row["projectID"];
echo $currentID."current ID<br>";
mysql_free_result($prodjectID_result);
return $currentID;
}else{
echo "<P>ERROR: failed to access database and return last projectID</P>";
exit;
}
}