Jump to content

mysql not inserting all data


tryant4d

Recommended Posts

Hi folks.
I'm using php to dynamically create a query from an array. When the query is run, it doesn't always insert all of the data. Some of the last columns are ignored. It happens on very long inserts... with over 50 columns in the table. But each column, with the exception of the first and optionally the last, are single digits

Is it timing out? Too big for a buffer?

How does one get around this?

[code]$connection = mysql_connect($db, $db_user, $db_pass) or die('1 '.mysql_error());
mysql_select_db($db_2, $connection) or die('2 '.mysql_error());
/*** constructing query that inserts data into table ***/
$query = "INSERT INTO ".$sectionName." (coID,";
for($i=1;$i<=count($_SESSION['currentSection'])-1;$i++){
$query = $query.$sectionNumber."_".$i.", ";
}
$query = $query.$sectionNumber."_".$i.")";
$query = $query." VALUES (\"".md5($_SESSION['setup']['coname'])."\",\"";
for($i=1;$i<=count($_SESSION['currentSection'])-1;$i++){
$query = $query.$_SESSION['currentSection'][$i]."\",\"";
}
$query = $query.$_SESSION['currentSection'][$i]."\")";
/*** cleaning query text ***/
$query = validateQuery($query);
if($result = mysql_query($query, $connection)){
mysql_close($connection);
...  [/code]



Thanks

Tom
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.