Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error on SQL query [duplicate]

Tags:

php

mysql

Possible Duplicate:
How to delete from multiple tables in MySQL?

i have a SQL query as follows

$deletebills=mysql_query("delete from bills,billsitems,cashier_trans where bills.bills_ID=billsitems.billsItems_BillItemSerial and bills.bills_ID=cashier_trans.cashier_trans_DocId and bills.bills_ID='".$_REQUEST['bills_ID']."'");

The Error :

#1064 - 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 'where bills.bills_ID=billsitems.billsItems_BillItemSerial and bills.bills_ID=cas' at line 1

how can i solved it.

like image 508
Khalid Almallahi Avatar asked Mar 05 '26 22:03

Khalid Almallahi


1 Answers

You can't delete from all tables at once. You must delete from each table. MySql Delete

like image 188
Alexandru Chelariu Avatar answered Mar 08 '26 13:03

Alexandru Chelariu