GUI Code

  Home arrow GUI Code arrow SIMPLE Databse Driven Web Site
GUI CODE

SIMPLE Databse Driven Web Site
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2002-06-26

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    This script is to make your site Database Driven. It is VERY simple, VERY SIMPLE indeed!

    By : lgetreu

    <?php
    // Email me for help: liam.getreu@gmail.com

    // Make a MySQL Database called "db" with a table named "variables" with three rows ("id", "title", and "content"). Insert your data. Then call the page by going variables.php?id=1 etc.

    $id = $_GET['id'];

    $db = mysql_connect("localhost", "username", "password");
    mysql_select_db("db",$db);

    $sql="SELECT * FROM variables WHERE id=" . $id;
    $result=mysql_query($sql,$db);

    $num = mysql_num_rows($result);
    $cur = 1;

    while ($num >= $cur) {

    $row = mysql_fetch_array($result);

    $id = $row["id"];
    $title = $row["title"];
    $content = $row["content"];

    echo "<li>Id = $id<br>";
    echo "Title of page = $title<br>";
    echo "Content = $content</li>";

    $cur++;
    }

    ?>
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More GUI Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    GUI CODE ARTICLES

    - PHP Image Manipulation Class 1.0
    - Simple PHP-CAPTCHA,
    - dPhoto
    - nice looking dir index'r
    - Colorpicker
    - Exposure Gallery build 1226
    - Dynamic "AQUA" Buttons
    - AdminTool|1.0 for Exposure Gallery
    - Exposure Gallery v1.2
    - Crop Canvas
    - Display all available background colours
    - Exposure Gallery v1.0
    - JPEG Directory Thumbnail system (Apect ratio)
    - JPEG Directory thumbnail system
    - Change Background Color each day


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap