Page 1 of 1

mysql: will not insert, same code has worked for me before.

Posted: Sat Jun 09, 2007 4:16 pm
by zyklon

Code: Select all

$idid=$userd['id'];
mysql_query("INSERT INTO newsinf (rtime,message,toid) VALUES ('".time()."','<b>$j','$idid')");
$idid=$attacke['id'];
mysql_query("INSERT INTO newsinf (rtime,message,toid) VALUES ('".time()."','<b>$q','$idid')");
Thats the code, all the stuff in the table exists, $j and $q are set as strings. [s]u[/s] you can see $idid set, there is no reason for it to not work.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.

Posted: Sat Jun 09, 2007 4:28 pm
by feyd
Proof MySQL is refusing this is where?

Posted: Sat Jun 09, 2007 4:30 pm
by zyklon
it isn't being put into the table, but there is no mysql error being shown on the page.

Posted: Sat Jun 09, 2007 4:33 pm
by feyd
No error being shown on page can be that you don't have error checking. Post more code.

Posted: Sat Jun 09, 2007 4:36 pm
by zyklon
all the things above it and around it work. it is just those 4 lines. that don't appear to be working, should I put in a

Code: Select all

or die(mysql_error());
at the end of each line??

Posted: Sat Jun 09, 2007 4:39 pm
by feyd
Have you tried it?

Posted: Sat Jun 09, 2007 4:52 pm
by zyklon
is it possible to overload a string??

Code: Select all

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
then it gives me part of what is in $j, though i checked the part it stops, and there is nothing there to cause the problem.


edit: fixed it i had a ' in the middle of the part i inserted into the string:)