CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Two statement's don't execute in Custom Insert

Print topic Send  topic

Author Message
Tomek
Posted: 07/09/2004, 1:58 AM

Hi !

I have created custom insert sql code. Within this sql code I put two statements one for insert and one for update. I put a semicolon ; beetwen them and still receive mysql error:

(You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; UPDATE crm_organizatorzy SET or_status = 'p' WHERE or_id_orga)

I think that this error concers the fact that I cann't execute two sql statements at once. But if I paste these queries into phpmyadmin it works fine.

Do you have any clue how can I use custom insert to perform several statemens at once ???

Best Regards
Tomasz
Sixto Luis Santos
Posted: 07/09/2004, 8:28 AM

Tomasz,

As you found out, multiple queries is not a function of either the MySQL
engine or of the PHP engine. phpMyAdmin actually parses the query and
creates multiple separated queries before submitting to the MySQL server.

You should send your second query using the "After Insert" event of the
record form.

e.g.
  
//  
global $DByour_connection;  
$rec_id=$your_form->field_with_id->GetValue();  
$DByour_connection->query("UPDATE crm_organizatorzy SET or_status = 'p'  
WHERE or_id_organizatorzy=$rec_id");  
//  

Regards,
Sixto
Tomek
Posted: 07/10/2004, 9:09 AM

Thank you Richard for your help. Anaway it would be nice if mysql could perform mulitiple queries :-)

Tomek



Quote Sixto Luis Santos:
As you found out, multiple queries is not a function of either the MySQL
engine or of the PHP engine. phpMyAdmin actually parses the query and
creates multiple separated queries before submitting to the MySQL server.

Add new topic Subscribe to topic   


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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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