Grow your CSS skills. Land your dream job.

How can I make this…..?

  • # September 5, 2009 at 7:11 pm

    I need to create page on website fezayarns.com which will display a list of products (thumbnails, you can organize them by name or category). When you click on thumbnail, separate page will open with full description of product. There will be about 200-400 items and new will be added every month. I was thinking about php+mysql…
    Just give me an idea where to start. (php, javascript….)
    Thank you.

    Rob
    # September 5, 2009 at 7:15 pm

    I would check the sticky threads out first in the Jquery and this PHP help forum ;)

    # September 5, 2009 at 10:17 pm

    didn’t find anything, does anyone know any plugins or good tutorials. Thank you.

    # September 6, 2009 at 11:27 pm
    "netxm" wrote:
    I need to create page on website fezayarns.com which will display a list of products (thumbnails, you can organize them by name or category). When you click on thumbnail, separate page will open with full description of product. There will be about 200-400 items and new will be added every month. I was thinking about php+mysql…
    Just give me an idea where to start. (php, javascript….)
    Thank you.

    That’s a pretty broad question. You’re probably not going to find anyone that will write something up for you, so you might as well start attempting to learn/search for things on your own. Check out the Diving into PHP videos over at nettuts.com (they are linked in a thread that is stickied on this forum). Watch all of them and you’ll probably learn something you can use to accomplish what you need. However, I’ll help out a little.

    Anyway, you would probably need to create several general SQL queries for each of your conditions. On your main page you seem like you seem like you want to display all of your products. All of these products (I’m assuming) are already in a database somewhere. For arguments sake, let’s call the database "information."

    You’d probably want to connect to your database first. If you’re using PHP, you’d do something like this (I’m assuming you’d be using MYSQL too):

    Code:
    < ?php
    $host = 'localhost';
    $db_user = 'root';
    $db_password = 'root';
    $db_name = 'information';
    $con = mysql_connect($host,$db_user,$db_password);
    if (!$con) {
    die('Could not connect: ' . mysql_error());
    }
    mysql_select_db($db_name);
    ?>

    So now you are connected to host using your ‘information’ database. Next you would probably want to select all of your products from your table that we will call ‘products’ and print them out.

    Code:
    < ?php
    $result = mysql_query("SELECT * FROM products");
    while ($row = mysql_fetch_object($result)) {
    echo $row->field_name1;
    echo $row->field_name2;
    }
    ?>

    // Close the connection if you’re done with it
    mysql_close($con);

    The above code is one of several ways to output information from a database. I’d suggest reading the PHP manual to learn more about interacting with MYSQL – http://us3.php.net/manual/en/ref.mysql.php.

    What I wrote is a super basic example, but it might help you a little bit. Only other thing I can say is that you’ll need to do some reading/watching on your own to understand things for your self. Cheers.

    # September 7, 2009 at 3:13 am

    Thank you synic, I’ve already started to read PHP & MySQL book from SitePoint http://www.sitepoint.com/books/phpmysql4, watched 13 days of Dive into PHP from Nettuts, and tried to follow tutorial on sitepoint (http://www.sitepoint.com/article/php-gallery-system-minutes/) , but with no luck so far. So, I guess, I’m moving in right direction. Thanks again.

    # September 16, 2009 at 10:08 pm

    Since your going to have tons of content fist off I would recommend a using pagination. There is a great tutorial on this here: http://www.phpfreaks.com/tutorial/basic-pagination

    If you need any help shoot me an email bmdsherman[at]gmail[dot]com, I am working on builiding up my portfolio and would love to help.

    # September 29, 2009 at 4:24 am

    Hi,

    This is really good discussion and informative too. I joined to solve my problem of how to connect to database ? can you guide me ? :P :lol: :|

    Thanks,

    # September 29, 2009 at 6:30 am

    patricksnead24,
    Is this what your looking for?

    Code:
    < ?php
    //Connect to MYSQL server
    $conn = mysql_connect('host', 'username', 'password') or die ('Error connecting to mysql');

    //Select the Database
    mysql_select_db('database_name');

    //You can also do something like SELECT * FROM table_name WHERE column_name='$var'
    $result=mysql_query("SELECT * FROM table_name")
    while($row = mysql_fetch_assoc($result)){
    echo $row['column_name'];
    ?>

    # September 29, 2009 at 8:33 am

    I have been using php and mysql provided in my hosting provider. I learned it by searching for training videos especially in youtube. Try it.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".