Im building a credit card applicatoin and Im getting a bizarre problem where sometimes an sql statement works and the next call the identical sql statement simply won't work.

Personally, i suspect it is the host company Im using maybe simply not being fast enough to simply accept large volumes of sql calls towards the database, however i figure I'll atleast request to ascertain if other people has ever endured similar issues

It may be the values you're dynamically contributing to the query statement. You need to escape the values to make certain they don't break your query.

In PHP you should use the mysql_escape_string() function. Documentation here: http://us3.php.internet/mysql_escape_string

Also if you're running the query from the browser, you are able to normally begin to see the error should you choose something similar to this:

$query = mysql_query("QUERY", $db_connection) or trigger_error(mysql_error())

Presuming you do not have the mysql general query log if you are on the shared host and should not customize the database's my.cnf file, you may draft up a function like:

function dbInsertQuery($query, $conn) inspections around the query here

     $mysql_query($query, $db_connection) or trigger_error(mysql_error())

     if (!$isProd &lifier&lifier is_writable($logFile)) 

       $logLine = date(DATE_RFC822) . " - " . $query

       if (fwrite($handle, $logLine) === FALSE) 

       fclose($handle)

     

   

This will help you to log all of your queries to some log file. I occur a $isProd variable that you should toggle for development, and when it's set towards the something of TRUE, it will not log towards the file, and can skip the who fopen process entirely. You may want to adjust it, and may even have it to operate every query and not simply card inserts should you wanted.