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
    Member Borior's Avatar
    Join Date
    Jul 2003
    Posts
    30
    Member #
    2253
    I've been using PHP for a while but haven't really learnt about mysql.

    If, say, I had a template for a site, and I wanted to place in the body of each page a name, address and phone number etc etc. all formatted in a table.

    a) how would i go about placing the information in mysql tables using a form

    b) how would i go about retrieving the information from the tables

    thanks in advance

    Borior

  2.  

  3. #2
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    PHP Code:
    <?
    // Connect to the database
    mysql_connect('datbase_name');
    // Insert a row
    $sql "INSERT INTO table_name (colomn1, colomn2) VALUES('$colomn1', '$colomn2')"
    mysqL_query($sql);

    // Get a row
    $sql "SELECT colomn1, colomn2 FROM table_name WHERE colomn1 = '$colomn1'";
    $result mysql_query($sql);
    $information mysql_fetch_array($result);

    // Print out results
    echo "colomn1:" $information['colomn1'];
    echo 
    "colomn2:" $information['colomn2'];
    ?>
    Just read up more on basic php/mysql interaction. There's some good starter tutorials on www.webmonkey.com
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site


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 03:03 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com