Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two tables USER_INFO and USERS. It contains userid and id respectively. I want to delete complete record when userid and id get match.
suppose in USER_INFO table userid =125, and in USERS table id=125;
what query should i use to delete complete row.

What I have tried:

$tables = array('USER_INFO ', 'USERS');
$this->db->where('id''userid', '125');
$this->db->delete($tables);



or

DELETE USER_INFO, USERS FROM USER_INFO INNER JOIN USERS WHERE USER_INFO.userid = USERS.id =125
Posted
Updated 15-Mar-16 4:10am
v2

1 solution

Why not try it and see which one works?

Here is the tutorial reference for what you are trying to do MySQL Delete Join | DELETE with INNER JOIN and LEFT JOIN Examples[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900