topical media & game development

talk show tell print

basic-ajax-12-delete.php / php



  <?php
  
  require_once('connect.php');
   
  if (!dbConnect()) {
  echo "Unable to establish database connection";
  exit;
  }
  
  task_id = _GET['task_id'];
  
  if ((isset(_GET['task_id']))) {
                  
  sql = mysql_query("DELETE FROM tasks WHERE task_id = " . task_id);
  
  }
  
  result = mysql_query("SELECT * FROM tasks ORDER BY rank");
  
  if(!result) die("Query Failed.");
  
  echo '<ul id="task_list" class="sortable">';
  
  while(row = mysql_fetch_row(result)) {
  
  task_id = row[0];
  
  task = row[1];
  
  echo '<li id="task_';
  echo task_id;
  echo '">' . task . '</li>';
  
  }
  
  echo '</ul>'
  
  ?>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.