Page 1 of 1

DML functions

Posted: 2013-01-22 06:48
by azharhussain
Like sqlvalue function, which function shall i use for search, insert and update in the table (please share samples if you can) ?

Re: DML functions

Posted: 2013-01-23 09:50
by a.gneady
sql() is the function to use for this purpose. Here are some examples:

To delete/edit/insert:

Code: Select all

sql("update table `customers` set phone='123456789' where customerID=22", $eo);
To retrieve (select) records:

Code: Select all

$records = sql("select * from `customers` where state='NY' order by customerID", $eo);
while($customer = mysql_fetch_assoc($records)){
   echo "{$customer['firstName']} {$customer['lastName']} <br/>";
}