echo Name not ID along with other sql statement.
I have been working on a number of sites trying to get my old head around Sql Statements and have run into a issue when trying to combine some sql statements.
Echoing Name instead of ID i have worked out using the folowing code
SELECT Vehicle.*, manufacturer.VehicleManufacturerName
FROM Vehicle INNER JOIN manufacturer ON Vehicle.VehicleManufacturerID = manufacturer.VehicleManufacturerID
WHERE VehicleID = ParamVehicleID OR ( -1= ParamVehicleID2 AND VehicleID= ParamSessionVehicleID)
and i have worked out how to show 1 vehicle for the Car of the Week using the following statement
SELECT *
FROM vehicle
WHERE vehicle.VehicleCotw = 1
ORDER BY vehicle.VehicletUpdateDate ASC LIMIT 1
Here lies the problem
I have no idea on how to combine these two statments so that
1. shows the Manufacturer name not ID
2. Echos other details such as image price etc.
In a nutshell what i am trying to finish up with is showing 1 "Car of the Week" with image of car, Model of Car, Price of Car and Manufacturer Name.
At the moment i get all of the above except Manufacturer Name shows as ID.
I have attached my page to show what i have got using just the sql statetment
ELECT *
FROM vehicle
WHERE vehicle.VehicleCotw = 1
ORDER BY vehicle.VehicletUpdateDate ASC LIMIT 1
Any help here will be very appreciated.
Kind regards
Jonathon