Hopefully this should be a quick fix...
The first query in my script pulls information from two tables, one of which could be empty:
$query = "SELECT s.username, si.image1
FROM suppliers AS s
INNER JOIN supplierimages AS si ON s.username = si.username
WHERE s.username = '$id'";
$id = username (part of the session). Now, the problem I am having is when I need to update the supplierimages table with a username, supplierid and the details of the image:
$query = "UPDATE `supplierimages` as si
SET `si.image1 = '$image1', `si.username` = '$id' INNER JOIN `suppliers` as s ON `s.supplierid` = si.supplierid WHERE s.username = '$id'";
I get an error on this query:
"check the manual that corresponds to your MySQL server version for the right syntax to use near 'si.username= '' INNER JOINsuppliersas s ONs.supplierid` = si.supplierid ' at line 2"
Any ideas?
Thanks,
G