This is my first PHP application I've ever made; I started learning PHP this week, so don't kill me, ok? ;)
I'm trying to use this script to find which DJs in our database are available. For some reason, when I manually enter the region like:
'regions' LIKE \'tn_tricities\'
it returns results, but when I enter it like:
$region = 'tn_tricities'
...
`regions` LIKE \'$region\'
it doesn't return any results. Any idea how to fix this? or if I'm totally going in the wrong direction and this is not the best way to check availability, PLEASE let me know!
The full code:
$region = $_GET['region'];
$date = $_GET['date'];
require "connect.php";
echo $region;
$sql = 'SELECT `vendorName`, `vendorBio`, `vendorType`, `regions` FROM
`vendors` WHERE `regions` LIKE \'$region\' AND `datesBooked` NOT LIKE
\'$date\' AND `datesUnavailable` NOT LIKE \'$date\' ';