ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:learn_abstraction:record_insertion

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v5:userguide:learn_abstraction:record_insertion [2016/03/15 17:50] – [Updating Multiple Records] use a complete PHP statement for multiple records update dregadv5:userguide:learn_abstraction:record_insertion [2016/03/20 16:48] (current) – [Inserting A Record] mnewnham
Line 26: Line 26:
    
 /* /*
- * result executes "INSERT INTO people (first_name,last_name) values ('Carol',Smith')";+ * result executes "INSERT INTO people (first_name,last_name)  
 +                                values ('Carol',Smith')";
  */  */
 </code> </code>
 +
 +AutoExecute helps, because it can automatically determine the type of the field to be created, quoting data appropriately, and can even handle special characters in the fields.
 ==== Updating A Record ==== ==== Updating A Record ====
 To update a record, we must also know how to retrieve the record uniquely, for example there might be a sequence number on the table that uniquely identifies each one. In the following example, the requested record is identified by an id number of 305: To update a record, we must also know how to retrieve the record uniquely, for example there might be a sequence number on the table that uniquely identifies each one. In the following example, the requested record is identified by an id number of 305:
Line 42: Line 45:
  
 /* /*
- * result executes "UPDATE people SET first_name='Caroline',last_name='Jones' WHERE id=305";+ * result executes "UPDATE people SET first_name='Caroline', 
 +*                                     last_name='Jones'  
 +*                                     WHERE id=305";
  */  */
 </code> </code>
Line 56: Line 61:
  
 <WRAP info 300px center> <WRAP info 300px center>
-**End Of Lesson 1**+**End Of Lesson**
 </WRAP> </WRAP>
v5/userguide/learn_abstraction/record_insertion.1458060636.txt.gz · Last modified: 2017/04/21 11:40 (external edit)