Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with array/ pull field from table based on value

Status
Not open for further replies.

blasterstudios

Technical User
Dec 30, 2004
128
US
I have a standard repeat region. It's for an invoice. The invoice stores a product id for each product on the invoice, rather than the product name. Now that I'm ready to print the invoice onto the screen, i need to swap those product id's with the actual product name. This can be referenced in another table called products. I'm very familiar with access, and that is how i began working in databases, but i'm still trying to figure out php. anyway, i think i need to use an array to pull all the products to reference with the id's. I'm sure this is simple, but I still can't figure out how array's work. Can anyone help?
 
How is the data stored>? in db tables? If so then do a join in the query to get both the id and the product name. then its a simple matter of moving thru the record set and ouputting the required value

Bastien

Cat, the other other white meat
 
yeah, everything is stored in 2 separate sql tables. i'm not too familiar with joining tables in sql. i understand the concept from my knowledge using Access, but don't understand how to connect them in php, as well as how to display them, i.e.

if (invoice.productid = products.productid) {
echo products.productid;
}

i'm sure that wouldn't work, but is that about the way it's supposed to be done?

i'm gonna research on joining tables. i'll let you know if i figure it out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top