ainoy31 Posted September 4, 2007 Share Posted September 4, 2007 Hello- I have an issue with querying. I keep getting the following error message: Error Unknown column 'fs_startdate' in 'where clause' I have checked many times to make sure that the column exist and it does because I am able to display the start date information. Here is the code I am trying to query: $sql = "SELECT * FROM flight_schedule WHERE fs_startdate = '$reqDate' AND fs_deptport = '$reqDeptAirport' AND fs_destport = '$reqDestAirport'"; $result = mysql_query($sql) or die("Error " . mysql_error()); $num = mysql_num_rows($result);...etc Here is the code in creating the flight_schedule table: CREATE TABLE IF NOT EXISTS flight_schedule ( fs_ID int( NOT NULL auto_increment, fs_deptport varchar(32) NOT NULL, fs_destport varchar(32) NOT NULL, fs_startdate varchar(16) NOT NULL, fs_enddate varchar(16) NOT NULL, carrier_email int(16) NOT NULL, carrier_name varchar(32) NULL, carrier_phone varchar(12) NULL, PRIMARY KEY (fs_ID) ) Why would it not recognize the column existing when it does exist? Also, if I choose fs_enddate, I get the same error message. Much appreciation. Quote Link to comment Share on other sites More sharing options...
fenway Posted September 4, 2007 Share Posted September 4, 2007 How? Quote Link to comment Share on other sites More sharing options...
ainoy31 Posted September 4, 2007 Author Share Posted September 4, 2007 My DBconnect.php was linking to another DB. Quote Link to comment 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.