Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    1
    Member #
    36135
    how do i go about creating a site like amazon,ebay and such were the content can change. I know using a data base and sql and php but I do a layout for 20 items i can only pull info for that 20 items. If I am not managing the site and the guy wants to add 10 more items onto the database I then would have to add spots not on the database but on the html page itself. if i added the extra spots on the html and there's no info on the database it would be a bunch of blank spots. unless there's some css or something to hide the div if the data is empty or something.
    as you can see there are 20 cars the php pulls all the data from the database to populates all the fields. but if you take away 5 cars there would be 5 empty fields

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    It works like this ....

    You put rows of items into a database (like MySQLi). That database can have 100, 1000, or a million items ... it doesn't matter.

    A PHP script queries that database. Which means it pulls out rows based on a particular search, a range of prices, by color, by mileage, whatever. The query returns the rows to PHP as an array. The array only contains the items that you want to display (based on a search or some 'selection' of items). The PHP script knows how many there are in the array.

    The PHP script loops through that array and dynamically generates the HTML it needs to display the items however you want.

    A good analogy is this website you're using right now (web design forums). The page you are now looking at is created by a PHP script. The post you are viewing right now is taken from a MySQL database and displayed on this web page. Everyone using web design forums right now is executing the same PHP script. It just serves each of us different content depending on what we need to see. If you look up at the URL in your browser address bar, you'll see various codes, numbers, titles that PHP uses to pick out information from the database.



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:46 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com