very strange problem with insert command
Moderator: General Moderators
- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
very strange problem with insert command
i 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!
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!
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
check to make sure you have a record in your table that has a value like that first of all..
in other words, it will only display values that have 313.1729 in the actual value...
so, if you have a number like 245313.172924 it will return a row.. otherwise, it returns no rows.. also make sure you are in the correct table.
other than t hat, the syntax you are using is fine as it should return a row if there is an order number that actually fits that description you are giving it.
in other words, it will only display values that have 313.1729 in the actual value...
so, if you have a number like 245313.172924 it will return a row.. otherwise, it returns no rows.. also make sure you are in the correct table.
other than t hat, the syntax you are using is fine as it should return a row if there is an order number that actually fits that description you are giving it.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
first i work with hebrew>!
maybe i need to do a codepage set first!
then how do i do it in php?
second when i did copy of paste from the table i got this :
'þ172þ.þ313þ'
the strabge leteers i see as spaces in mysql
and when i do a select on 'þ172þ.þ313þ'
it works but i dont understand why?
thanks again
peleg
maybe i need to do a codepage set first!
then how do i do it in php?
second when i did copy of paste from the table i got this :
'þ172þ.þ313þ'
the strabge leteers i see as spaces in mysql
and when i do a select on 'þ172þ.þ313þ'
it works but i dont understand why?
thanks again
peleg
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK