topical media & game development

talk show tell print

basic-ajax-12-insert.php / php



  <?php
  
  require_once('connect.php');
   
  if (!dbConnect()) {
  echo "Unable to establish database connection";
  exit;
  }
  
                  
  task = _POST['task'];
  
  task = mysql_real_escape_string(task);
  
  if ((isset(_POST['task']))) {
                  
  sql = mysql_query("INSERT INTO tasks (task)" . "VALUES ('task')");
  
  }
  
  result = mysql_query("SELECT task_id, task 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.