select query problem

Charlie2

Registered User.
Local time
Today, 00:53
Joined
Mar 28, 2002
Messages
79
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.

Code:
if (!($query = $dbh->prepare("SELECT registration, colour FROM car
WHERE make = '$make'
 AND model = '$model'  ")))
{
        &outputErr("couldn't prepare statement".$dbh->errstr);
}
 

Users who are viewing this thread

Back
Top Bottom