I have 2 tables:
university
:
university_id(p.k) | university_name
and user
:
uid | name | university_id(f.k)
How to keep university_id
NULL in user table?
I am writting only 1 query, my query is:
INSERT INTO user (name, university_id) VALUES ($name, $university_id);
Here $university_id
can be null from front end.
university
table will be set bydefault by me.
In the front end, student will select the university name, according to that the university_id
will pass to user
table, but if student is not selecting any university name then is should pass null value to the user
table for university_id
field.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…