Example 4
Finally, we will delete all the entries we added.
Program File # 1: <?php 
# 2:
require_once("../fastsql.inc");
# 3:
define("G_HOST""localhost");
# 4:
define("G_DBUSER""MyUsername");
# 5:
define("G_DBPWD""MyPassword");
# 6:
define("G_NORMDB""MyDB");
# 7:
# 8:               
# 9:
$conn = new FastSQL;
#10:
$delete_statement "delete from ADDRESSES where ID > 3";
#11:
$do_delete $conn->update($delete_statementG_NORMDB);
#12:
#13:
$select "select * from ADDRESSES order by Name";
#14:
$res $conn->query($selectG_NORMDB);
#15: print 
"<pre>";
#16:
print_r($res);
#17: print 
"</pre>";
#18:
#19:
?>
The result will look like this # 0: <?
# 1:
Array
# 2: (
# 4:     [
0] => Array
# 5:         (
# 6:             [
ID] => 2
# 7:             
[Name] => Jill
# 8:             
[Phone] => 4785521
# 9:             
[MODIFIED] => 20050814180607
#10:             
[CREATED] => 00000000000000
#11:         
)
#13:     [
1] => Array
#14:         (
#15:             [
ID] => 1
#16:             
[Name] => John
#17:             
[Phone] => 28877112
#18:             
[MODIFIED] => 20050814180607
#19:             
[CREATED] => 00000000000000
#20:         
)
#22:     [
2] => Array
#23:         (
#24:             [
ID] => 3
#25:             
[Name] => My dog
#26:             
[Phone] => 04487 445512
#27:             
[MODIFIED] => 20050814180607
#28:             
[CREATED] => 00000000000000
#29:         
)
#31: )
Note that the update function can be used both for UPDATE and DELETE statements.

My Sites