P. 1
SQLITE Php Pdo Referance

SQLITE Php Pdo Referance

|Views: 797|Likes:
Published by jwzumwalt
SQLite Reference - Using PHP & PDO
SQLite Reference - Using PHP & PDO

More info:

Published by: jwzumwalt on Mar 02, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/26/2015

pdf

text

original

$query ="INSERT INTO 'tablename' VALUES('col1Data','col2Data','col3Data')";
$result =$db->query("$query") or die(" Error: $query");

Listing: 5.1 –  insert data – inserting a single row (record) of information.

We did not specify an id. Because id is a primary field, SQLite is smart enough to automatically increment a unique
number for us.

Listing‐5.1 is a short form of the INSERT command and expects a value for every column (field). If we intend to leave some
columns blank or are going to edit or update certain columns in a row, we must specify which column names we are going
to be working with.

Long version of INSERT

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->