+ Reply to Thread
Results 1 to 3 of 3

Thread: Inserting single records to my database...

  1. #1
    darylcarpo is offline x10Hosting Member darylcarpo is an unknown quantity at this point
    Join Date
    Oct 2008
    Posts
    21

    Inserting single records to my database...

    Need to know does any know how to insert a records to my datase? Need help 'coz I dont know honestly.:happysad:

  2. #2
    dickey's Avatar
    dickey is offline x10 Sophmore dickey is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Singapore
    Posts
    128

    Re: Inserting single records to my database...

    If you are using PHP and MySQL...
    you must login to your SQL using

    $mysqli=mysqli("localhost","username","password"," databasename");
    then create a query string like...

    $query = "INSERT INTO tablename (integer_field, varchar_field)
    VALUES (1,'This is a string.')";

    then do a query...
    $res = mysqli_query($mysqli,$query);

    then never forget to close your mysqli connection to free up overhead.

    mysqli_close($mysqli);

    This is a simple and generic formula I am not really sure if my syntax is correct but it should point you to the right direction.
    if you need more help please do not hesitate to post again and if you need a more specific answer please post more information regarding what you really want to achieve.
    Don't get me wrong as I believe if and when I help someone I also help myself whereby whatever someone learns I also learn.

    But I will also accept credits or reps if you really want to part with it.

  3. #3
    KSclans is offline x10 Sophmore KSclans is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    198

    Re: Inserting single records to my database...

    Quote Originally Posted by dickey View Post
    If you are using PHP and MySQL...
    you must login to your SQL using
    So is it MySQL or SQL ?

    if you using SQL do what dickey said
    if you are using MySQL use http://w3schools.com/php/php_mysql_connect.asp

    and if you want to insert data to MYSQL database
    http://w3schools.com/php/php_mysql_insert.asp

    search w3school before you post questions

+ Reply to Thread

Similar Threads

  1. MySQL not inserting into database?
    By War of the Lands in forum Programming Help
    Replies: 11
    Last Post: 09-11-2008, 07:08 AM
  2. install drupal
    By abhi666 in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 02-18-2008, 08:05 AM
  3. PHP BB 2.0.16 Manual instalation
    By GFIV in forum Free Hosting
    Replies: 8
    Last Post: 09-14-2005, 12:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers