i need help again... T.T
Posted: Sat Jan 17, 2004 12:29 pm
$addStmt = "Insert into $tableName1(order_no, username, item_no, quantity, date) values('%d','%s','%s','%d','%s')";
...statement to connect db....
//Execute the statement
if(!mysql_query(sprintf($addStmt,$order_no,$username,$item_no,$quantity,$date),$link))
{
DisplayErrMsg(sprintf("Error in executing %s stmt",$stmt));
DisplayErrMsg(sprintf("error:%d %s",mysql_errno ($link),
mysql_error($link)));
exit();
}
---------------------------------------------------------------------------------
($addStmt,$order_no,$username,$item_no,$quantity,$date),$link))
---------------------------------------------------------------------------------
Sorry ! i having troble again . the values i insert into db "date". can i use %s ?
and the statement here...table field can represent in $order_no ? or just put the field name "order_no" ?
...statement to connect db....
//Execute the statement
if(!mysql_query(sprintf($addStmt,$order_no,$username,$item_no,$quantity,$date),$link))
{
DisplayErrMsg(sprintf("Error in executing %s stmt",$stmt));
DisplayErrMsg(sprintf("error:%d %s",mysql_errno ($link),
mysql_error($link)));
exit();
}
---------------------------------------------------------------------------------
($addStmt,$order_no,$username,$item_no,$quantity,$date),$link))
---------------------------------------------------------------------------------
Sorry ! i having troble again . the values i insert into db "date". can i use %s ?
and the statement here...table field can represent in $order_no ? or just put the field name "order_no" ?