On Aug 9, 2011, at 3:41 PM, Peter Lind wrote:
On 9 August 2011 22:38, Chris Stinemetz chrisstinem...@gmail.com
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
On 9 August 2011 20:31, Chris Stinemetz chrisstinem...@gmail.com wrote:
Okay. I am pretty new to mysql so this may seem like a ridiculous
question to some people.
I am trying to use a LEFT JOIN query, but the results I am finding
unusual. For every record occurrence there is for the query,
Is users.user_id unique?
yes it is.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 9 August 2011 20:49, Chris Stinemetz chrisstinem...@gmail.com wrote:
Is users.user_id unique?
yes it is.
What does your result look like? Hard to say what the problem is
without seeing the result.
--
hype
WWW: plphp.dk / plind.dk
LinkedIn: plind
BeWelcome/Couchsurfing: Fake51
Twitter:
What does your result look like? Hard to say what the problem is
without seeing the result.
I am echoing the query and printing the get array just for debugging
purposes, but below you can see how it is repeating its' self.
Thank you
Array
(
[id] = Bella Roe 4980 Roe Blvd
)
Bella
On 9 August 2011 21:23, Chris Stinemetz chrisstinem...@gmail.com wrote:
What does your result look like? Hard to say what the problem is
without seeing the result.
I am echoing the query and printing the get array just for debugging
purposes, but below you can see how it is
Okay. I just validated it is not in the left join query, but in my php. I
was able to build the correct relations.
Does anyone see any think in the php code below that may cause duplicate
table rows?
Thank you all.
?php
//store.php
include_once 'includes/connect.php';
include_once
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
On Tue, Aug 9, 2011 at 2:55 PM, Frank Flynn fr...@declan.com 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
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
--
hype
WWW: plphp.dk / plind.dk
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/)
On 9 August 2011 22:25, Chris Stinemetz chrisstinem...@gmail.com 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?
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
On 9 August 2011 22:38, Chris Stinemetz chrisstinem...@gmail.com 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
I am not up to scratch with innodb, but in oracle
you would have a Primary key on both the id fields in the Car and person
table and a Foreign key on PersonId linking it to Id in the Person table.
IN your select an index on PersonId would be beneficial if the tables get
large.
Jack
2008/10/2 J
On Thu, Oct 2, 2008 at 6:50 AM, Jack van Zanen [EMAIL PROTECTED] wrote:
I am not up to scratch with innodb, but in oracle
you would have a Primary key on both the id fields in the Car and person
table and a Foreign key on PersonId linking it to Id in the Person table.
IN your select an
ry 2001 01:53
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] foreign key problem
hello all!
i have a little problem ,hope someone can help me out
the problem is :
let i have two tables T1 and T2 ,now T1 has following
fields
cntryid
cntryname
cntrycode etc.
now cntryid is the primary key
ation (table), R1, then
every R2.F entry must either be a value equal to an R1.P primary key value
or be null"
Regards,
Chris
-Original Message-
From: Bob Hall [mailto:[EMAIL PROTECTED]]
Sent: 31 January 2001 01:53
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] foreign k
18 matches
Mail list logo