Re: [PHP-DB] Re: php-db foreign key

2011-08-10 Thread Karl DeSaulniers
On Aug 9, 2011, at 3:41 PM, Peter Lind wrote: On 9 August 2011 22:38, Chris Stinemetz wrote: Yes, debug your code and figure out why it's looping twice instead. For instance, try the other query in the mysql console. Thank you! It was the first query. I put a LIMIT 1 on it and now it i

Re: [PHP-DB] Re: php-db foreign key

2011-08-09 Thread Peter Lind
On 9 August 2011 22:38, Chris Stinemetz wrote: >> >> Yes, debug your code and figure out why it's looping twice instead. >> For instance, try the other query in the mysql console. >> > > Thank you! It was the first query. I put a LIMIT 1 on it and now it is > working correctly. I appreciate your h

Re: [PHP-DB] Re: php-db foreign key

2011-08-09 Thread Chris Stinemetz
> > Yes, debug your code and figure out why it's looping twice instead. > For instance, try the other query in the mysql console. > Thank you! It was the first query. I put a LIMIT 1 on it and now it is working correctly. I appreciate your help! Thank you, Chris -- PHP Database Mailing List (h

Re: [PHP-DB] Re: php-db foreign key

2011-08-09 Thread Peter Lind
On 9 August 2011 22:25, Chris Stinemetz wrote: >> >> Your php code had more than one query running (one inside the other). >> It's the outer query that runs twice, not the inner one returning >> double the results >> > > > Thanks Peter, > > Do you have any suggestions on how to fix this? > > Thank

Re: [PHP-DB] Re: php-db foreign key

2011-08-09 Thread Chris Stinemetz
> > Your php code had more than one query running (one inside the other). > It's the outer query that runs twice, not the inner one returning > double the results > Thanks Peter, Do you have any suggestions on how to fix this? Thank you, Chris -- PHP Database Mailing List (http://www.php.net

Re: [PHP-DB] Re: php-db foreign key

2011-08-09 Thread Peter Lind
> > When I dump the query and run it in console I get the results I want. Not > sure what I am doing wrong. Your php code had more than one query running (one inside the other). It's the outer query that runs twice, not the inner one returning double the results -- WWW: plphp.dk / plind.dk Link

[PHP-DB] Re: php-db foreign key

2011-08-09 Thread Chris Stinemetz
On Tue, Aug 9, 2011 at 2:55 PM, Frank Flynn wrote: > > You already have a foreign key, that is stores.store_by references users.user_id. You might not have declared it (which is OK) but if that is the key you want that is fine. > I suspect you are seeing an inadvertent Cartesian product. The way

[PHP-DB] Re: php-db foreign key

2011-08-09 Thread Frank Flynn
You already have a foreign key, that is stores.store_by references users.user_id. You might not have declared it (which is OK) but if that is the key you want that is fine. I suspect you are seeing an inadvertent Cartesian product. The way you have written this query you will get one row from