|
Posted by J.O. Aho on 03/11/07 19:21
Martin wrote:
> Hi
> Sorry about the following but I am lower than a newbie when it comes to PHP,
> I don't understand its full capabilities!
>
> I am looking for a way to improve my website. I do not know if PHP is the
> answer but.... I want to have one page that presents images and details of
> items for sale. Currently my site just presents lots of hyperlinks to pages
> each with one of my items on. Every page is basically the same with just a
> different product on it.
>
> Am I right to think that PHP and MySQL will enable me to call different or
> several items to one "main" page?
Much depends on how you want to have your site
You could make a database (in MySQL) where you have a table that
contains the information like
item_id = auto increasing value that the database takes care for you
item_name = a name for the item in question
item_desc = description of the item you are selling
item_image = path to the location of the image for the item
item_price = the asked price
item_quant = how many you may have of the item in question
item_sold = if the item has been sold
A such table should take care of most options.
In the main page script you may select all items from the database that
hasn't been sold and fetch the item_id and the item_name
You link all to the second page, with just the difference that you give
different id numbers
<a href="http://www.example.net/show.php?id=<?PHP $item_id ?>"><?PHP
$item_name ?></a>
and in the second page you fetch all data belonging to the id sent to
the page.
It's quite simple thing to do, but nothing I'm not willing to do here,
but you will get a few useful links, coding in PHP is quite similar to
C/C++.
PHP On-Line manual:
http://se2.php.net/manual-lookup.php?lang=en&function=&x=8&y=8
PHP Reserved variables. http://www.php.net/manual/en/reserved.variables.php
MySQL On-Line manual. http://www.mysql.com/search/?q=&x=6&y=8&doc=1&m=0
Don't roget to read the user comments on the on-line manuals, they give
you a lot of good information.
--
//Aho
Navigation:
[Reply to this message]
|