I don't know if this post is valid here but I thought it might be so here goes.
I have a MYsql database and I am developing a Perl script that runs a query against this database to output all the registrations and colours of the make and model of the car selected in a form.
I think my problem lies in my select query, I hope someone here can spot the error as it is driving me nuts, I know there is a problem because if I swap the fields registration and colour around my results change.
Anyway here is the query, at the moment this only outputs one registration number and no colour per query.
I have a MYsql database and I am developing a Perl script that runs a query against this database to output all the registrations and colours of the make and model of the car selected in a form.
I think my problem lies in my select query, I hope someone here can spot the error as it is driving me nuts, I know there is a problem because if I swap the fields registration and colour around my results change.
Anyway here is the query, at the moment this only outputs one registration number and no colour per query.
Code:
if (!($query = $dbh->prepare("SELECT registration, colour FROM car
WHERE make = '$make'
AND model = '$model' ")))
{
&outputErr("couldn't prepare statement".$dbh->errstr);
}