List Info

Thread: MySQL Muliple Tables and PHP




MySQL Muliple Tables and PHP
user name
2006-05-30 09:31:50
I'm having a lot of trouble with SELECT statements over
multiple tables
and using a lookup reference table.

I have 3 tables I need to select data from: 'is_details',
'is_materials_lookup' and 'is_materials'.

The table 'is_materials_lookup' contains a field from
'is_details'
('style_code') and field from 'is_materials'
('material_code') as well
as the obligatory 'id' primary key.

is_materials contains the 'material_code' and 'material'
fields.

I want my php page to read all of the fields from the
'is_details'
table, and then lookup values in 'is_materials' where the
'style_code'
matches that used in the current record in 'is_details' as
noted in the
lookup table.

I hope this all makes sense - if not I will be more then
happy to
provide more details.

I have code that I have written so far, but I don't want to
paste it
directly. Is there a site I can paste my code and provide
you a link to
view it?

Thanks in advance.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP & MySQL" group.
To post to this group, send email to phpmysqlgooglegroups.com
To unsubscribe from this group, send email to
phpmysql-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/phpmysql
-~----------~----~----~----~------~----~------~--~---

MySQL Muliple Tables and PHP
user name
2006-05-30 09:43:27
Here is my code that might give you a better indication of
what I'm
trying to achieve:

http://pastebin.com/746431



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP & MySQL" group.
To post to this group, send email to phpmysqlgooglegroups.com
To unsubscribe from this group, send email to
phpmysql-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/phpmysql
-~----------~----~----~----~------~----~------~--~---

MySQL Muliple Tables and PHP
user name
2006-05-30 09:34:46
Ok - found a paste bin for the code I've got so far:
http://pastebin.com/746423



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP & MySQL" group.
To post to this group, send email to phpmysqlgooglegroups.com
To unsubscribe from this group, send email to
phpmysql-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/phpmysql
-~----------~----~----~----~------~----~------~--~---

MySQL Muliple Tables and PHP
user name
2006-05-30 10:02:15
Here is my code:

http://pastebin.com/746446



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP & MySQL" group.
To post to this group, send email to phpmysqlgooglegroups.com
To unsubscribe from this group, send email to
phpmysql-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/phpmysql
-~----------~----~----~----~------~----~------~--~---

MySQL Muliple Tables and PHP
user name
2006-05-30 10:14:11
Ok

I've managed to get the SQL statement reading the tables
and outputting
the correct data. Now I just need to make it so that the
material field
shows as a list, rather than the script copying out all of
the details
again.

Here is my code so far: http://pastebin.com/746462



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP & MySQL" group.
To post to this group, send email to phpmysqlgooglegroups.com
To unsubscribe from this group, send email to
phpmysql-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/phpmysql
-~----------~----~----~----~------~----~------~--~---

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )