It appears you have not yet registered with our community. To register please click here...


Inserting into a sql database

This is a discussion on Inserting into a sql database within the Coding Tutorials forums. Topic: Welcome to the tutorial, inserting into a mysql database is pretty easy. Code: mysql_query(); This is the code often used ...


Reply
 
Postbit Seperator LinkBack Thread Tools Postbit Seperator Search this Thread Postbit Seperator Display Modes
Old 12-10-2006, 01:36 PM   #1 (permalink)
 
Status: Junior Member
Join Date: Dec 2006
Posts: 25
Trader Rating: (0)
Retire at 21 is on a distinguished road
TD$: 0.00
Donate
Default Inserting into a sql database
Welcome to the tutorial, inserting into a mysql database is pretty easy.

Code:
mysql_query();

This is the code often used when using mysql query's

Code:
$tablename = 'table_name'; mysql_query("insert into $tablename (row1,row2) values('row1 value','row2 value') ");

This will insert into the table table_name and into the rows row1 and row2, we've also gave the rows some values.

You can add stuff to the end of insert querys like

Code:
mysql_query("insert into table_name (row1,row2) values('row 1 value','row 2 value') limit 1 ");

This will make sure the querry only takes place once.

Register @ Retire at 21 If you like this tutorial
Retire at 21 is offline   Reply With Quote
Table Bottom LeftTable BottomTable Bottom Right
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




Home | Site Map | Contact | Archive | Top

 

Copyright © 2007 - 2010 iTalkWebs Network

Search Engine Optimization by vBSEO 3.1.0