Snippets v2

Languages
My Snippets

Execute SQL with ADODB Login or Register to Bookmark this snippet

Description PHP

This code is an example of how to execute SQL code with an ADODB connection.

Requires the ADODB Library and prior connection.

The Code Download
  1. <?php
  2. $sql = "DELETE FROM `units` WHERE `unit_id`='".$_REQUEST['unit']."'";
  3. if ($db->Execute($sql) === false) {
  4.     echo 'Error: '.$db->ErrorMsg();
  5. } else {
  6.     if ($db->Affected_Rows()) {
  7.         echo 'Unit has been deleted';
  8.     }
  9. }
  10. ?>
Credits Contact JC

Added by JC on 12th November, 2007

Comments

There are no comments about this snippet.

Post Comment HTML is allowed

You must be registered and logged in to post a comment.

Login here to post a comment