Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    Senior Coder DJCMBear's Avatar
    Join Date
    Mar 2010
    Location
    United Kindom
    Posts
    1,173
    Thanks
    14
    Thanked 136 Times in 136 Posts
    For putting the text into the database just use a mysql insert code with validation for sql injection etc.

    The code I posted with the sql query will do the id call after the "?id=" which $_GET['id'] will get that number so that should work.
    Official BinPress hand picked coder.
    For anyone worried about SQL injection go have a look at my small yet powerful script here.
    Go Pledge for Light Table, if it hit's $300,000 Python and other languages will get added.
    I am 1 of 65,608 people to get a Pebble Watch :P

  2. #17
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,497
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Since you do not even have the MySQL database yet ...

    You need to go into your webhost and create a MySQL database.
    Give it a username, password, and database name and enter those
    into the script below. Follow your webhost configuration on the
    name of the MySQL host.

    This script creates the table you'll need.
    Upload to your webhost and run it after you enter-in the account data:
    PHP Code:
    <?php
    // Create the table and columns

    // You should have already created the MySQL account
    // with a database named "MyText".

    // The name of your database goes here.
    $dbname 'MyText';

    // Enter in your host, username and password here.
    $link mysql_connect("host","username","password") or die("Couldn't make connection.");

    // Select the database
    $db mysql_select_db($dbname$link) or die("Couldn't select database");

    // This creates the table called "LinesOfText".
    // The actual line of text (max of 255 characters),
    // A timestamp ... you might want to use that later on,
    // The submitters IP ... in case you want to use that,
    // and an enable, if you later decide to "hide" or "enable" lines.

    mysql_query("CREATE TABLE LinesOfText 
    (
    TextID int NOT NULL AUTO_INCREMENT, 
    PRIMARY KEY(TextID),
    TextLine varchar(255),
    TimeStamp varchar(12),
    UserIP varchar(20),
    TextEnable varchar(3)
    )"
    ) or die(mysql_error());  ;

    echo 
    "table created";

    ?>
    Last edited by mlseim; 06-02-2010 at 01:49 AM.

  3. #18
    New Coder
    Join Date
    Jun 2010
    Posts
    37
    Thanks
    2
    Thanked 0 Times in 0 Posts
    hi, im looking for this exact thing also!!
    how do i create a website from scratch? i have the sql database ready and the domain, all i have to do is install files into the thing to make it work... where do i start?
    i am doing EXACTLY as what the OP was looking for, how do i start out!?
    thanks!! (:

  4. #19
    New Coder
    Join Date
    Jun 2010
    Posts
    37
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Sorry for double posting as i dont know where to start,
    can someone give me a STEP BY STEP how to install this whole script to make it work on my website?

    thanks!!
    URGNT also! (:

  5. #20
    Senior Coder DJCMBear's Avatar
    Join Date
    Mar 2010
    Location
    United Kindom
    Posts
    1,173
    Thanks
    14
    Thanked 136 Times in 136 Posts
    Quote Originally Posted by jeree View Post
    Sorry for double posting as i dont know where to start,
    can someone give me a STEP BY STEP how to install this whole script to make it work on my website?

    thanks!!
    URGNT also! (:
    I have just created the full system for JonathanFenny if you want it also PM me an email to post the zip file to.
    Official BinPress hand picked coder.
    For anyone worried about SQL injection go have a look at my small yet powerful script here.
    Go Pledge for Light Table, if it hit's $300,000 Python and other languages will get added.
    I am 1 of 65,608 people to get a Pebble Watch :P


 
Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •