List box with 'blank' row, (PHP MySQL, DWCS4)
I have a form with a list box, in which i want to display the contents of a recordset and an additional 'blank' row, displayed at the top of the list.
My approach has been to create a union query with my blank row followed by my true recordset.
if I try the following...
SELECT ItemID, ItemName, Price
FROM tblblankitem UNION (SELECT ItemID, ItemName, Price FROM tblitem
WHERE Display = 0
ORDER BY ItemID DESC)
i run test and get the expected result, however the blank row doesn't appear in my list.
when i select the list box and click the 'bind to dynamic source' button, i get a message saying there is an error in my sql syntax (there isn't as far as i can see)
is there another way i can appropach this ?
UPDATE
if I change the order of the query, (which isn't as good as this won't give me the desired order)
SELECT ItemID, ItemName, Price FROM tblitem
WHERE Display = 0
ORDER BY ItemID DESC
UNION
SELECT ItemID, ItemName, Price
FROM tblblankitem
i don't get the sql error anymore, (but i still don't see the row in my list box)