I am using mysql database and I am looking for a way to display particular rows for column B when the column A value meets a specific criteria.
For Example in TBL_NAME: ColumnA = Months ColumnB = Holidays
Veterans Day Thanksgiving etc...
I would like to display on a page all the Holidays occurring in the month of November. I do not want to display any holidays in other months. Here is the code I have which is returning the error "Unknown column 'ColumnA' in 'where clause'."
<?php
error_reporting(0);
require 'db/connect.php';
$Month=November;
$data = $conn->query("SELECT * FROM TBL_NAME WHERE ColumnA=$Month") or die($conn->error);
$numRows = $data->num_rows;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Database Connect</title>
</head>
<body>
<?php
// Print results to the page
while($row = $data->fetch_assoc()) { ?>
<p><?php echo $row['LinkName']; ?></p>
<?php } ?>
</body>
</html>