Jump to content

[SOLVED] Unknown column in where clause


jeff5656

Recommended Posts

In my database table I have a variable called which_month.  The values are November, December, etc.

I want the following code to pull the record with with the current month, but when I run this code I get: "Invalid query: Unknown column 'November' in 'where clause'"

 

<?php 
include ("../connectdb.php");
$curr_month = date (F);
$consultsq1 = "SELECT * FROM `staffsched` WHERE `which_month` = $curr_month";
$result = mysql_query ($consultsq1) or die ("Invalid query: " . mysql_error ());
$row = mysql_fetch_array ($result);
?>

Link to comment
https://forums.phpfreaks.com/topic/133553-solved-unknown-column-in-where-clause/
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.