check coding

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
enefahchen
Forum Newbie
Posts: 10
Joined: Wed May 12, 2004 1:35 am

check coding

Post by enefahchen »

can check for me, whether the following coding correct??

$sql = "insert into orderlist (SCID ,productID ,userID ,SCDate ,price ,quantity ,SCPrice)
values ('NULL','$proI[$id]','$username','$todate',$price,$quantity,$total)";
$result = mysql_query($sql, $db);
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Re: check coding

Post by patrikG »

Change

Code: Select all

$sql = "insert into orderlist (SCID ,productID ,userID ,SCDate ,price ,quantity ,SCPrice) 
values ('NULL','$proI[$id]','$username','$todate',$price,$quantity,$total)";

Code: Select all

$sql = "insert into orderlist (SCID ,productID ,userID ,SCDate ,price ,quantity ,SCPrice) 
values ('NULL','{$proI[$id]}','$username','$todate',$price,$quantity,$total)";
and see if that works. If not: post the error message you're getting.
Post Reply