1. There is a database called "products". It contains the fields "productName", "productID", and "productDescription".
2. This database is queried, and the results are placed in an array called productArray. ProductArray is passed to a function called showSearchResults.
3. showSearchResults uses a foreach loop to display the "productName" of each element in the array. Each displayed name is hyperlinked to a page called "showMoreInfo.php".
4. When any of these hyperlinks are clicked, "showMoreInfo.php" will display the "productDescription" of whichever product's hyperlink was clicked.
It's steps 3 and 4 that I can't seem to figure out. I'm not even sure that I can use the foreach loop, because, if I use it to display the productNames, it acts as if $productId doesn't exist. I also don't know how to tell showMoreInfo.php which hyperlink was clicked.
I'd appreciate specific coding suggestions for the showSearchResults function and the showMoreInfo.php page,
2006-11-09
03:58:00
·
1 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design