Re: [PHP-DB] grabbing from multiple tables

2010-05-01 Thread Karl DeSaulniers
: -Original Message- From: Karl DeSaulniers [mailto:k...@designdrumm.com] Sent: Friday, April 30, 2010 1:50 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] grabbing from multiple tables No, please confuse me. I need to know this stuff. @Peter thanks for that introduction to foreign keys

Re: [PHP-DB] grabbing from multiple tables

2010-05-01 Thread Peter Lind
On 30 April 2010 20:49, Karl DeSaulniers k...@designdrumm.com wrote: No, please confuse me. I need to know this stuff. @Peter thanks for that introduction to foreign keys. Since my productoptions table is based off of items in products, optionGroups and options, would I use foreign keys for

Re: [PHP-DB] grabbing from multiple tables

2010-05-01 Thread Peter Lind
On 1 May 2010 10:13, Karl DeSaulniers k...@designdrumm.com wrote: What is the SQL query I can use to get an item that has two IDs? Something to the effect of... $q = SELECT OptID = '$OptID' FROM .PRODUCT_OPTIONS. WHERE ProdID = '$ProdID' AND OptGrpID='$OptGrpID'; Close but no cigar. $q =

Re: [PHP-DB] grabbing from multiple tables

2010-05-01 Thread Karl DeSaulniers
Thank you Peter... again.. :) Which would be the source field and which the target field? Karl On May 1, 2010, at 3:22 AM, Peter Lind wrote: On 30 April 2010 20:49, Karl DeSaulniers k...@designdrumm.com wrote: No, please confuse me. I need to know this stuff. @Peter thanks for that

Re: [PHP-DB] grabbing from multiple tables

2010-05-01 Thread Karl DeSaulniers
GOLD! Thank you. Karl On May 1, 2010, at 4:12 AM, Peter Lind wrote: On 1 May 2010 11:00, Karl DeSaulniers k...@designdrumm.com wrote: Thank you Peter... again.. :) Which would be the source field and which the target field? You place the constraint on the table that has the foreign key.

Re: [PHP-DB] grabbing from multiple tables

2010-05-01 Thread Karl DeSaulniers
@Peter To be honest, this is my first one. So the margin for error is probably there, I just cant see it. BUT, I did get this database file pre-made from WebAssist. Its their E-Commerce database file they gave out. (Sorry if I am repeating myself) So the structure was set up by another and I am

Re: [PHP-DB] grabbing from multiple tables

2010-04-30 Thread Peter Lind
On 30 April 2010 12:02, Karl DeSaulniers k...@designdrumm.com wrote: Hello All, I have a product database. In that database there are several tables dealing with individual products. I am wanting to set up an editProduct and a productInfo page. For the bulk info, I am fine. For the product

Re: [PHP-DB] grabbing from multiple tables

2010-04-30 Thread Karl DeSaulniers
Thanks Peter. So what is the logic behind foreign keys? Why use them? Thx. Karl Sent from losPhone On Apr 30, 2010, at 5:09 AM, Peter Lind peter.e.l...@gmail.com wrote: On 30 April 2010 12:02, Karl DeSaulniers k...@designdrumm.com wrote: Hello All, I have a product database. In that

Re: [PHP-DB] grabbing from multiple tables

2010-04-30 Thread Peter Lind
On 30 April 2010 12:26, Karl DeSaulniers k...@designdrumm.com wrote: Thanks Peter. So what is the logic behind foreign keys? Why use them? Constraints. When using, for example, the InnoDB engine in MySQL, you can set foreign key fields on tables. These ensure that your record will always be

Re: [PHP-DB] grabbing from multiple tables

2010-04-30 Thread Peter Lind
On 30 April 2010 13:41, DZvonko Nikolov dzvo...@yahoo.com wrote: Hi, don't confuse the guy. Don't talk down to the man. He asked questions and got usable answers including links to where he could find more info. -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn:

Re: [PHP-DB] grabbing from multiple tables

2010-04-30 Thread Karl DeSaulniers
...@gmail.com Subject: Re: [PHP-DB] grabbing from multiple tables To: Karl DeSaulniers k...@designdrumm.com Cc: php-db@lists.php.net php-db@lists.php.net Date: Friday, April 30, 2010, 12:31 PM On 30 April 2010 12:26, Karl DeSaulniers k...@designdrumm.com wrote: Thanks Peter. So what is the logic behind

Re: [PHP-DB] grabbing from multiple tables

2010-04-30 Thread Karl DeSaulniers
, 2010, at 2:59 PM, David Murphy wrote: -Original Message- From: Karl DeSaulniers [mailto:k...@designdrumm.com] Sent: Friday, April 30, 2010 1:50 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] grabbing from multiple tables No, please confuse me. I need to know this stuff. @Peter

Re: [PHP-DB] grabbing from multiple tables

2010-04-30 Thread Karl DeSaulniers
.. :) Karl On Apr 30, 2010, at 2:59 PM, David Murphy wrote: -Original Message- From: Karl DeSaulniers [mailto:k...@designdrumm.com] Sent: Friday, April 30, 2010 1:50 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] grabbing from multiple tables No, please confuse me. I need to know