php - How to relate SQL tables -


i have 2 tables want check data perform respective tasks according has been got.

scenario

tables

  • jobs
  • applications

what want achieve is, if job, job1 has been applied user1, should stored in applications table. if user1 tries apply same job(job1), user1 should notified has applied job. want on how can go using php , sql

i understand want achieve hard write entire code you.so going show direction on how go it.you need stored procedure following :

checks if user has applied job :

  select count(applicationid) tblapplication userid=@userid && jobid=@jobid   if(count >0)  throw exception  else  insert...  end 

this gives outline.do research on stored procedures first.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -