?php
/
*
connect
to
database
*
/
mysql_pconnect(
"localhost"
,
"mysql_user"
,
"mysql_password"
)
or
die
("Could
not
connect")
;
/
*
this
should
return
the
correct
numbers
of
deleted
records
*
/
mysql_query("DELETE
FROM
mytable
WHERE
id
10")
;
printf
("Records
deleted
:
%d\n"
,
mysql_affected_rows())
;
/
*
without
a
where
clause
in
a
delete
statement
,
it
should
return
0
*
/
mysql_query("DELETE
FROM
mytable")
;
printf
("Records
deleted
:
%d\n"
,
mysql_affected_rows())
;
?
|