I’m stuck on an mysql query. I usually just put the result set into an array and use var = $row['column']; . I am unable to do that this time. The query is as such.
$dbTaskRecords = mysql_query("Select Time, TruckId, TaskNo, PickupLocation, DropOffLocation
From booking
Where driver='$driver'
And Date= CAST('$Date_search' AS DATE)
Union All
Select Time, TruckId, TaskNo, PickupLocation, DropOffLocation
From returnbooking
WHERE driver='$driver'
And Date= CAST('$Date_search' AS DATE)
Order By TaskNo Asc");
If I try to use:
$row = mysql_fetch_array($dbTaskRecords);
I get an error.
How do I go about getting the outputs to variables?
Thanks guys.
mysql_fetch_array() expects parameter 1 to be resource, boolean given
this means that your query has an error
try to add this line before fetching the content