Welcome Guest, Not a member yet? Register   Sign In
populating a checkbox from database

It looks like it should work.

Try changing the following:

The productsbyshop records should have a unique reference id.

change 'count(productsbyshop.product_id)' to count '(productbyshop.uniqueid)'

if it still doesn't work, try removing the count and group and just listing the product.product_id and productbyshop.unique_id.

You should get all product.product_id and NULL where the productbyshop record does not exist.


[eluser]sore eyes[/eluser]
Hi Obiron, many thanks for your help. I do appreciate it. I have tried making the changes that you suggest, but to no avail. I introduced the unique id and taken out the group and count, but it does not list all the product.product_id. By the way, the counting is working successfully, but only limited to '1'.

I suspect the answer lies in the WHERE clause. This clause may be limiting the resultant set to only those values that have a product_id in the productsbyshop table. If this is the case, I don't know how to work around it. What do you think?

Theme © iAndrew 2016 - Forum software by © MyBB