Results 1 to 9 of 9

Thread: Insert Data Into a Database Table

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2005
    Posts
    46,704

    Default Insert Data Into a Database Table

    The INSERT INTO statement is used to add new records to a database table.

    Code:
    <?php
    
    $link = mysql_connect("servername", "username", "password") or die("unable to connect to mysql");
    $db  = mysql_select_db("database_name ") or die("unable to select DB");
    
    mysql_query("INSERT INTO Persons (FirstName, LastName, Age)
    VALUES ('', '', '')");
    
    mysql_close($link);
    
    ?>
    Last edited by minisoji; 11-29-2011 at 11:01 AM.

Bookmarks

Posting Permissions

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