Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-15-2007, 07:14 AM
WebProWorld Member
 

Join Date: Feb 2007
Location: United Kingdom
Posts: 40
lala RepRank 0
Default 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
Reply With Quote
  #2 (permalink)  
Old 06-15-2007, 04:48 PM
DrTandem1's Avatar
WebProWorld 1,000+ Club
 

Join Date: Oct 2003
Location: Encinitas, CA
Posts: 1,908
DrTandem1 RepRank 2
Default 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
Reply With Quote
  #3 (permalink)  
Old 06-15-2007, 06:10 PM
WebProWorld New Member
 

Join Date: Oct 2005
Location: Tempe, AZ
Posts: 17
4bidden RepRank 0
Default Re: PHP/MySQL basic question

Look up information on $_GET. You'll probably go "Oh, I've seen that before".

PHP: Predefined variables - Manual
Reply With Quote
  #4 (permalink)  
Old 06-15-2007, 10:54 PM
WebProWorld New Member
 

Join Date: Mar 2006
Posts: 4
ramorius RepRank 0
Default 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
__________________
Rob Morin
www.familytimeplanner.com
Reply With Quote
  #5 (permalink)  
Old 06-16-2007, 11:39 AM
WebProWorld Member
 

Join Date: Feb 2007
Location: United Kingdom
Posts: 40
lala RepRank 0
Default 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
Reply With Quote
  #6 (permalink)  
Old 06-18-2007, 08:25 AM
WebProWorld New Member
 

Join Date: Jun 2007
Posts: 15
vsd32 RepRank 0
Default 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
Reply With Quote
  #7 (permalink)  
Old 06-19-2007, 02:25 PM
WebProWorld Member
 

Join Date: Feb 2007
Location: United Kingdom
Posts: 40
lala RepRank 0
Default 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
Reply With Quote
  #8 (permalink)  
Old 06-19-2007, 09:45 PM
sands's Avatar
WebProWorld Veteran
 

Join Date: Sep 2005
Location: Kerala, India
Posts: 397
sands RepRank 1
Default Re: PHP/MySQL basic question

Quote:
Originally Posted by lala View Post
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.
__________________
My Nook | My Biz | My Photos
Reply With Quote
  #9 (permalink)  
Old 06-20-2007, 10:41 AM
WebProWorld Member
 

Join Date: Feb 2007
Location: United Kingdom
Posts: 40
lala RepRank 0
Default Re: PHP/MySQL basic question

Cheers

lala
Reply With Quote
  #10 (permalink)  
Old 07-09-2007, 09:02 AM
WebProWorld New Member
 

Join Date: Jul 2007
Posts: 4
shilpi RepRank 0
Default Re: PHP/MySQL basic question

hey how to insert pictures in databse
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Question that may help a lot of people rhstock Search Engine Optimization Forum 10 05-03-2006 11:58 AM
Basic Question - please help jmdb71 Search Engine Optimization Forum 2 02-08-2005 01:21 PM
very basic php/mysql help needed. wen_laat Database Discussion Forum 6 11-20-2004 09:40 PM
real basic question TelecomHunter Web Programming Discussion Forum 3 10-03-2004 03:03 PM
Basic Cron Job Question OneMoreBite Web Programming Discussion Forum 1 05-17-2004 12:04 AM


Search Engine Optimization by vBSEO 3.2.0