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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.