Jump to content

[SOLVED] Unknown column name


ainoy31

Recommended Posts

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(8) 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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/67915-solved-unknown-column-name/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.