 |

06-15-2007, 07:14 AM
|
|
WebProWorld Member
|
|
Join Date: Feb 2007
Location: United Kingdom
Posts: 40
|
|
PHP/MySQL basic question
Hi there,
I am just starting with PHP and MySQL and am trying to get my head around some basics.
If I was to have a website with furniture for example I would have 30 products, which are organised in 3 ranges/4 different rooms. The navigation would be sth like view products by range with ranges and items underneath plus a choice for products by room with room and items underneath. All item details should be stored in the database.
So, when the user clicks on a table in a particular range for example, which code would I use that the item template will be populated with the appropriate item data/photos? Where I am stuck is how the selection from the navigation is "passed" to the created placeholders in the item webpage...
It would be great to get some help
lala
|

06-15-2007, 04:48 PM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: Oct 2003
Location: Encinitas, CA
Posts: 1,908
|
|
Re: PHP/MySQL basic question
This is basically a logic issue. The visitor would select the various combinations via a small PHP form. The PHP script would use if/else statements to flow and populate the selections as text and/or images along with associated prices, which could also be calculated within the same script(s).
It is possible to break a large script up into smaller ones as the selection process progresses/narrows.
Without using an actual data base, the information from the form(s) is passed to the next page/script by registering the variables selected from the previous page(s).
__________________
DrTandem's San Diego Web Page Design, drtandem.com
|

06-15-2007, 06:10 PM
|
|
WebProWorld New Member
|
|
Join Date: Oct 2005
Location: Tempe, AZ
Posts: 17
|
|
Re: PHP/MySQL basic question
Look up information on $_GET. You'll probably go "Oh, I've seen that before".
PHP: Predefined variables - Manual
|

06-15-2007, 10:54 PM
|
|
WebProWorld New Member
|
|
Join Date: Mar 2006
Posts: 4
|
|
Re: PHP/MySQL basic question
If I'm interpretting your challenge correctly, it sounds like you want a table with the item details (pictures, specs, prices, etc.) and a separate table for the ranges/rooms. (I'm not sure if you mean price 'ranges' or not, but that's what I'll assume for now.) So, in effect the second table would be for the rooms, and one of its fields would be the price range of the room. Another field would list the unique ids, or keys, of the items that belong to that room. Then, when you call your page, you select the room by price range and then select all of the item details for the items listed in that room.
This is kind of big picture, but I hope that it's helpful.
Good luck,
Rob
|

06-16-2007, 11:39 AM
|
|
WebProWorld Member
|
|
Join Date: Feb 2007
Location: United Kingdom
Posts: 40
|
|
Re: PHP/MySQL basic question
Thank you for your replies
It seems I did not clearly state what I am after, so I try to give some more details:
There should be a navigation bar to the left with two choices to see the products. One is via furniture ranges (oak classic, modern pine etc) and one is via room (living room, kitchen, bathroom etc).
All item details should be stored in a MySQL database and the left hand navigation should be "automatically" inserted into the webpages according to the entries in the database. For example if I was to add an item to the database and populate the necessary columns name, description, price, location of items photo, range, room, I would like the navigation bar to take over the entry and display the new entry automatically along with the given ones. Also, when a user clicks on a certain item I would like the web page to display the choosen product...
Hope I was a bit clearer this time. Am sorry that I am not good in explaining what I mean...
lala
|

06-18-2007, 08:25 AM
|
|
WebProWorld New Member
|
|
Join Date: Jun 2007
Posts: 15
|
|
Re: PHP/MySQL basic question
If i understood correct you want a dinamically changed menu. If you add a new entry in db show be visible on the menu.
If that i correct you just have to create your menu passing all rows from your table.
Example:
$resultID=mysql("medicine","SELECT CID,NumeCID FROM categorii WHERE NumeCID LIKE 'a%'");
while ($row = mysql_fetch_row($resultID))
{
$CID=$row[0];
$NumeCID2=$row[1];
echo"<a href=\"yourpage.php?CID=$CID\">$NumeCID2</a><br>";
}
Hope that helps
|

06-19-2007, 02:25 PM
|
|
WebProWorld Member
|
|
Join Date: Feb 2007
Location: United Kingdom
Posts: 40
|
|
Re: PHP/MySQL basic question
Yes, that is right.
I will try your given example and see how it works
Would you recommend that I install MySQL and PHP on my computer for learning purposes and if so, is there anything else I need (apart from more of a clue than I have  )? I litterally have not done this before, so I have to start from 0...
Thank you,
lala
|

06-19-2007, 09:45 PM
|
 |
WebProWorld Veteran
|
|
Join Date: Sep 2005
Location: Kerala, India
Posts: 397
|
|
Re: PHP/MySQL basic question
Quote:
Originally Posted by lala
Yes, that is right.
I will try your given example and see how it works
Would you recommend that I install MySQL and PHP on my computer for learning purposes and if so, is there anything else I need (apart from more of a clue than I have  )? I litterally have not done this before, so I have to start from 0...
Thank you,
lala
|
Yes, installing PHP, Apache and MySQL on your PC is the best.
|

06-20-2007, 10:41 AM
|
|
WebProWorld Member
|
|
Join Date: Feb 2007
Location: United Kingdom
Posts: 40
|
|
Re: PHP/MySQL basic question
Cheers
lala
|

07-09-2007, 09:02 AM
|
|
WebProWorld New Member
|
|
Join Date: Jul 2007
Posts: 4
|
|
Re: PHP/MySQL basic question
hey how to insert pictures in databse
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|