Jump to content

very strange problem with insert command


pelegk2

Recommended Posts

am working php+mySql

i am trying to do a simple insert command :

$query2=\"INSERT INTO tblPrint (OrderNum,PrinterNum,DateTimeVal) Values(\'$order_num\',\'$radio\',\'$tmpDateTimeVal\')\";

 

when i havethis values :

$order_num=313.517;

$radio=1;

$tmpDateTimeVal=date(\"Y-m-d H:i:s\");

 

when i check the mysql i see that the order_num value

is for some reason 3.517 ?!?!?!?!?!

why is that?any idea????

the more intresting if i do the same line with the same values it tels me its a duplicate key!!!!!!

but if i chek it from php with a select it tells m that that vakue dosent exist!!!!!!!!

help dont know what else to do!

 

after i did al of tht i did :

i changed the varchar to size 11

it at last put the data but when i do :

select * from tblprint where ordernum like \'%313.1729%\'

 

bu i get 0 records!!!why??????

Link to comment
Share on other sites

Try this...

 

If this is part of your script add it here...


$order_num=313.517; 

$radio=1; 

$tmpDateTimeVal=date("Y-m-d H:i:s");



$query2 = mysql_query("INSERT INTO tblPrint (OrderNum, PrinterNum, DateTimeVal) Values (\'$order_num\',\' $radio\', \'$tmpDateTimeVal\' )"); 

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.