Mysql insert where not join [duplicate]
This question already has an answer here: Return row only if value doesn't exist 2 answers i have tables: user_payments ID | OK | ---------- 1 | 1 | 2 | 0 | 3 | 1 | 4 | 1 | 5 | 1 | 6 | 0 | user_groups rID | ID | groups | ------------- 1 | 4 | member | 2 | 5 | member | I need to insert ID which has OK=1 to user_groups as member, but only if isn't already there. Is there any way of 'not join', or am I going totaly wrong way? Thank you for your help
You are looking for a left outer join with a condition is null on any column in the joined table.
Mysql - how to UPDATE table from another table with several WHERE conditions
PHP: cURL: Login and download file - CURLOPT_FOLLOWLOCATION issue
sending variables to php via ajax and jquery
php prints out “Terminated” without any error on terminal
Rank Average with PHP
Convert c++ function to PHP?
Syntax error 1064 in SQL Query in selecting an id from database : Symfony
Parse error: syntax error, unexpected 'ssh2_exec' (T_STRING) [closed]
Query to autonumbering manually by PHP Script
how can i decoding a JSON with ajax from symfony2 project?
Wordpress Custom Column Sorting
Unable to upload images to directory using move_uploaded_file?
refreshing a specific div id among many divs onclick href having that same id
Composer install fails with bus error: 10
Wordpress multi-user, custom database, potential concurrency problems when using global wpdb
store the PERMALINK in a PHP variable