my $sthQuery = $dbh->prepare('SELECT contact.forename, contact.surname, business.occupation, acn.position, contact.city, contact.country AS forename, surname, occupation, position, city, country WHERE contact.ruid=business.ruid AND contact.ruid=acn.ruid AND forename LIKE ? AND surname LIKE ? AND occupation LIKE ? AND position LIKE ? AND city LIKE ? AND country LIKE ?') or die "Couldn't prepare query: " . $dbh->errstr; #### Software error: Couldn't execute query: You have an error in your SQL syntax near 'WHERE contact.ruid=business.ruid AND contact.ruid=acn.ruid AND forename LIKE 'jo' at line 1 at /home/httpd/cgi-bin/basicsearch.cgi line 71. For help, please send mail to the webmaster (dan@timmy), giving this error message and the time and date of the error.