Remove Block Directly From Database - Drupal 7 I created a block and put in some invalid PHP code resulted in entire site not accessible at all. 

I'm fairly new to Drupal and I'm not a back-end programmer either. Much appreciated if you can provide a clear step-by-step guide on how to delete that particular block directly from the Database (PhpMyAdmin).
To delete a block programmatically using the Database API, try this:

$module = 'block';
$delta = 1;

// Get the block id (bid) required to delete the correct block from table 'block_custom'
$result = db_select('block', 'b')
         -&gt;fields('b', array('bid'))
         -&gt;condition('module', $module)
         -&gt;condition('delta', $delta)
         -&gt;execute();
$bid = $result-&gt;fetchField();

db_delete('block_custom')
  -&gt;condition('bid', $bid)
  -&gt;execute();

db_delete('block')
  -&gt;condition('module', $module)
  -&gt;condition('delta', $delta)
  -&gt;execute();

db_delete('block_role')
  -&gt;condition('module', $module)
  -&gt;condition('delta', $delta)
  -&gt;execute();


When creating custom blocks through the Drupal Block UI, the module name is block and the delta value is an integer. Be sure to use the correct delta value to delete the desired block.