cchipman
Posts: 7
|
| Posted: 10/06/2004, 9:34 AM |
|
I have one table that contains composition details. Each composition has an id column. There are about 20 other tables which contain test results for each composition, which is linked by an id field labeled as "comp_id".
I tried using the custom delete routine with the following entry:
DELETE FROM compimages WHERE comp_id = {comp_id};
DELETE FROM composition WHERE comp_id = {comp_id};
however, I got the following error message...
Database error: Invalid SQL: DELETE FROM compimages WHERE comp_id = 73; DELETE FROM composition WHERE comp_id = 73;
MySQL Error: 1064 (You have an error in your SQL syntax near '; DELETE FROM composition WHERE comp_id = 73' at line 1)
Session halted.
If I enter the lines from the error message above :
DELETE FROM compimages WHERE comp_id = 73; DELETE FROM composition WHERE comp_id = 73;
MySQL deletes them fine. So I suspect I'm not doing something correct. Can anyone offer me any advice?
_________________
Carl Chipman |
 |
 |
Karsten
Posts: 57
|
| Posted: 10/08/2004, 4:38 PM |
|
hi cchipman,
Quote :DELETE FROM compimages WHERE comp_id = 73; DELETE FROM composition WHERE comp_id = 73;
this works?
if so its new to me CCS supports multible deletes/inserts/updates
are you sure, that both tables are touched and and both records are deleted?
Karsten from Germany
_________________
If one gives up, he told himself he failed. |
 |
 |
cchipman
Posts: 7
|
| Posted: 10/25/2004, 10:00 AM |
|
It works if entered from the commandline or from phpMySqlAdmin tool. It doesn't work with the custom delete section though.
_________________
Carl Chipman |
 |
 |
GeorgeS
Posts: 206
|
| Posted: 10/25/2004, 10:48 AM |
|
I had some strange errors when I was trying to use {} brackets.
Try getting the value of the control differently if possible.
"DELETE FROM compimages WHERE comp_id =" .$form->conrol->GetValue(); ...?...
Maybe it will help...
_________________
GeorgeS |
 |
 |
peterr
Posts: 5971
|
| Posted: 10/25/2004, 1:49 PM |
|
You are working with PHP, not MySQL, therefore you need to follow PHP rules. Since PHP doesn't allow multiple SQL statements then this cannot work. Just write your custom code in two PHP lines instead of one.
Also see http://forums.devshed.com/archive/t-172340
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
mrachow
Posts: 509
|
| Posted: 10/26/2004, 1:11 AM |
|
I have found this: http://www.samspublishing.com/articles/article.asp?p=30875&seqNum=6
on Multiple Table Deletes and Updates for MySQL.
Regards,
Michael
_________________
Best regards,
Michael |
 |
 |