php


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.

Related Links

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

Categories

HOME
libgdx
windows-10
devexpress
android-emulator
facebook-android-sdk
stored-procedures
sharepoint-online
gtk
reportviewer
orc
texas-instruments
twisted
nest-api
c#-7.0
pickle
salt-cloud
deepfreeze
cmake-gui
spyder
libgit2
sqlplus
channel
android-cardview
pyspark-sql
django-import-export
adapter
javax.persistence
guice
intune
location-services
netbios
commonsware-cwac
opnet
nest
cloveretl
code-rally
microsoft-ui-automation
llvm-ir
cheat-engine
system-on-chip
minikube
tinyioc
skip-lists
mongodb-aggregation
sesame
instafeedjs
prefetch
google-identity-toolkit
logical
declarative
strpos
timestamping
exists
jeasyui
polymerfire
accessibilityservice
ioctl
odesk
linuxbrew
nette
phpredis
gflags
sablecc
python-c-extension
mojo
phonegap-facebook-plugin
hp-idol-ondemand
igor
storing-data
lumia-imaging-sdk
rpg
distributed-r
sqlbindparameter
pageviews
simplecov
user-forums
towers-of-hanoi
story
android-dialog
pageheap
jdom
nsfont
background-repeat
mmc3
data-dump
botnet
page-curl
azure-acs
tablet-pc
printqueue
bass
resharper-5.1
principles
cleartype
bucket
watchpoint
code-camp

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile