insert a record in table

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Vimalsingh
Forum Newbie
Posts: 2
Joined: Fri Apr 06, 2012 4:04 am

insert a record in table

Post by Vimalsingh »

Hi,
What is the steps used to insert a record in a table?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: insert a record in table

Post by Christopher »

(#10850)
User avatar
jayson.ph
Forum Contributor
Posts: 165
Joined: Mon Jan 02, 2012 9:20 am
Location: MP
Contact:

Re: insert a record in table

Post by jayson.ph »

Use,

Code: Select all

mysql_fetch_array
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: insert a record in table

Post by Christopher »

Don't use the mysql extension, it is no longer supported. The PDO docs have an INSERT example in the Contributed Notes: http://us3.php.net/manual/en/pdo.exec.php
(#10850)
joevega
Forum Newbie
Posts: 5
Joined: Mon Jun 25, 2012 6:17 am

Re: insert a record in table

Post by joevega »

insert into Table values('first value',' last value');
The insert into is used to add the records followed by the name of table. The open parenthesis follow the table name, that include list of values enclosed inside a parenthesis. The value given into the table will be positioned at respective rows and match up with column name specified in the table.
Post Reply