CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 I am stuck with db->query($mySQL); - HELP!

Print topic Send  topic

Author Message
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

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.