Jump to content

Recommended Posts

Hey guys,

 

What on earth is going on here? I'm getting a MySQL insert error, even though this code worked earlier... I'm thinking I have an extra character in there somewhere, but for the life of me, can't see it  ??? 

foreach ($inf as $key => $value)
{
		if (!mysql_query("INSERT INTO data (votes,date,prog,progname) VALUES ('".$inf[$key]['votes']."',".$global_date.",'".$key."','".$inf[$key]['progname']."')"))
		{
		trigger_error("MySQL Error occured : ".mysql_error($con), E_USER_WARNING );
		}

 

Thanks for your helpful (eyes!)

 

--Dave

Yep... sorry, there is another }  down in the code, but that's not the issue here (see error, pasted)

 

oh! pasting it, I see -- time has no ' at the end, I think

 

 

 

Error Level : 512 | Desc : MySQL Error occured : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '06:56:16,'0','Vegan school lunch options')' at line 1 [ /home/plmlorg/public_html/ChangeAnalytics2/test2.php=>90]

 

 

 

  Quote

I'm guessing you just missed it out, but the last curly bracket is missing.

 

Also is global_date and integer?

 

And can you post the exact error you get

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.