Trevor
|
| Posted: 09/14/2002, 11:42 PM |
|
I keep getting Parse error: parse error, unexpected T_OBJECT_OPERATOR when I try to run this. The problem arises when the query tries to run. The query seems fine and runs in MySQL by itself just fine. What am I doing wrong!!!!!!! Here is my code in the Open event of the form.
$mySQL = "INSERT INTO orders ( client_id, product1, total, repeatamount )
SELECT clients.client_id, clients.hosting_plan, hosting_plans.total, hosting_plans.repeatamount
FROM clients INNER JOIN hosting_plans ON clients.hosting_plan = hosting_plans.hosting_plan_id
WHERE clients.client_id = " . $fldclient_id;
//echo $mySQL;
db->query($mySQL);
PLEASE HELP!
|
|
|
 |
Sixto
|
| Posted: 09/15/2002, 8:42 PM |
|
Hmmm...
The correct syntax should be:
$db->query($mySQL);
^
And by the way, are you instantiating $db??
Something like:
$db = new clsDBconnection_name;
where connection_name is the name of your db connection (duh!)
E.G.
$mySQL = "INSERT INTO orders ( client_id, product1, total, repeatamount )
SELECT clients.client_id, clients.hosting_plan, hosting_plans.total, hosting_plans.repeatamount
FROM clients INNER JOIN hosting_plans ON clients.hosting_plan = hosting_plans.hosting_plan_id
WHERE clients.client_id = " . $fldclient_id;
//echo $mySQL;
$db=new clsDBconnection_name;
$db->query($mySQL);
Regards,
Sixto
|
|
|
 |
Trevor
|
| Posted: 09/15/2002, 9:07 PM |
|
Hmmmmmmm! is right! Why does the obvious always trip one. I stared at the code for hours and never even saw the missing $ for db->. Thank you very much!
Cheers,
Trevor
|
|
|
 |
|