Posted By

Hos4m on 08/09/10


Tagged


Versions (?)

Problem in MySQL


 / Published in: PHP
 

ألأول شوف الصورة ده :http://img713.imageshack.us/img713/3037/capturetm.png النتيجة ده وصلت لمجرد اني بعمل ريفريش في الصفحة اللي المفروض أضيف منها المهمة يعني أعمل ريفريش تنضاف واحدة جديدة أوتوماتيكياً وده الكود اللي فيه عرض النتائج وإرسالها مع بعض

  1. <?php
  2. include ("config.php");
  3.  
  4. echo "Welcome ".$_SESSION['name']." to your 2Do list";
  5.  
  6. $id = $_GET['id'];
  7. $task = $_POST['task'];
  8. $insert = mysql_query("INSERT INTO tasks (id,text) VALUES ('$id','$task')") or die ("Mysql error in insert");
  9.  
  10. $show_tasks = mysql_query("SELECT * FROM tasks where id=".$id." ") or die ("mysql error in show_tasks");
  11.  
  12. while ( $results = mysql_fetch_assoc($show_tasks) ) {
  13. echo "
  14. <input type='checkbox' name='donetask' /><h3>".$results['text']."</h3>
  15. ";
  16. }
  17.  
  18.  
  19. <form action='profile.php?id=".$id."' method='post'>
  20. <input type='text' name='task' />
  21. <input type='submit' value='Save' />
  22. </form>
  23. ";
  24.  
  25. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: pixelsoul on August 17, 2010

I don't speak Arabic but.... I don't see a problem with the script you have here. Echoing out the $task variable comes back with data after form submit. You either have an issue with the database configuration possibly or something you have in config.php is conflicting with this code and causing a problem.

You need to login to post a comment.