plodos Posted May 22, 2008 Share Posted May 22, 2008 MyDatabase CREATE TABLE department ( dept_id INT NOT NULL, dept_name TEXT, PRIMARY KEY (dept_id) ); DROP TABLE IF EXISTS proficiency; CREATE TABLE proficiency ( p_id INT NOT NULL, p_name TEXT NOT NULL, PRIMARY KEY (p_id) ); DROP TABLE IF EXISTS doctor; CREATE TABLE doctor ( d_id INT NOT NULL PRIMARY KEY, d_name varchar(50) NOT NULL, d_surname VARCHAR(50) NOT NULL, d_add TEXT NOT NULL, SSN INT NOT NULL, d_tel INT NOT NULL, d_bdate DATETIME NOT NULL, # 2003-03-31 11:22:12 p_id INT NOT NULL, dept_id INT NOT NULL, FOREIGN KEY (dept_id) REFERENCES department (dept_id), FOREIGN KEY (p_id) REFERENCES proficiency (p_id) ); Problem is starting here $_u ="UPDATE doctor dr, proficiency p, department d SET dr.d_name='$_d_name', dr.d_surname='$_d_surname', dr.d_add='$_d_add', dr.SSN='$_SSN', dr.d_tel='$_d_tel', dr.d_bdate='$_d_bdate', d.dept_name='$_dept_name', p.p_name='$_p_name' WHERE dr.d_id ='$id' AND dr.dept_id = d.dept_id AND dr.p_id = p.p_id ;"; I want to UPDATE doctor departments and doctor informations, but i dont know how to write multiple querys.... how can I do that? Quote Link to comment https://forums.phpfreaks.com/topic/106813-mysql-update-tables-problem/ Share on other sites More sharing options...
fenway Posted May 23, 2008 Share Posted May 23, 2008 What is the problem? Quote Link to comment https://forums.phpfreaks.com/topic/106813-mysql-update-tables-problem/#findComment-548155 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.