Home
   About Me
   Rene's Resume
   Presentations
   Services
   Rates & Contracts
   Portfolio / Clients
   Demo Apps
   White Papers & Tips
   Tutorials
   Contact Me
 

Insert, Update and Delete

Actually, all of these three database routines are SQL calls that don't return anything other than the number of affected rows. The Perl DBI interface lumps them all under the "do" directive. It would certainly be possible to do the same thing under PHP. I've chosen to break it out into three separate calls because having different routine names makes the code you write a bit easier to read. Self-documentation is all it is.

5.1 Insert

    $sql->Insert("insert into TEST values (0,'J.D.','18','23000')");
    $affected_rows = $sql->a_rows;
    

5.2 Update

    $sql->Update("update TEST set Name = 'Jane Doe' where ID = 6");
    $affected_rows = $sql->a_rows;
    

5.3 Delete

    $sql->Delete("delete from TEST where ID = 4");
    $affected_rows = $sql->a_rows;
    
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/astute/www/html/template.php on line 198
 

This page was generated in 0.0029 seconds.
Website content © 2018