Jump to content

ghqwerty

Members
  • Posts

    83
  • Joined

  • Last visited

    Never

Everything posted by ghqwerty

  1. Warning: implode() [function.implode]: Bad arguments. in C:\xampp\htdocs\inventory.php on line 64 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 same mf'n warning what does delete_check do ??
  2. this is what i get when i echo out $_POST['delete']; delete! :S wierd now im officially confused has got to be something to do with this <input type=\"checkbox\" name=\"delete[]\" value=".$item['itemid']."> # possibly something to do with the delete[] ??? or woul it be the value ???
  3. le form tag <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  4. ive done that but nothing is being printed <input type=\"checkbox\" name=\"delete[]\" value=".$item['itemid']."> thats where the array SHOULD be being formed i think
  5. getting this error Warning: implode() [function.implode]: Bad arguments. in C:\xampp\htdocs\inventory.php on line 64 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
  6. ok i will fix is that comment explainin the implode thing ???
  7. hmm still not working what it is part of is an inventory page where there are checkboxes for each item you own and a delete button and im trying to get it so that when you click the delete button everything that is selected is deleted here is the whole code for you $deleted = $_GET['delete']; if(isset($deleted)){ foreach($deleted as $dId){ $delete = mysql_query("delete from items where itemid = ".(int)$dId."") or die('crap'); //Adding an (int) will help avoid SQL errors } } $result = mysql_query("select itemid, item from items where userid = ".(int)$_SESSION['id']) or die('summit went wrong'); $count = mysql_num_rows($result); if($count <1){ print("<tr><td colspan=\"3\"><center>You currently have no items.<center></td></tr>"); }else{ while($item = mysql_fetch_array($result)){ print("<tr><td><center>".$item['item']."</center></td><td width=\"40%\"><center>".$item['itemid']."</center></td><td width=\"10$\"> <input type=\"checkbox\" name=\"delete[]\" value=".$item['itemid']."> </td></tr> "); } print("<tr><td colspan='3'><p align='right'><input type='submit' name='delete' id='delete' value='delete!'</p></td></tr>"); }
  8. im new here got recommended by a friend of my dads could some one please help me with a problem im getting this error Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\inventory.php on line 57 line 57 = foreach($deleted as $dId){ the section of code its in = if(sizeof($deleted)){ foreach($deleted as $dId){ $delete = mysql_query("delete from items where itemid = ".(int)$dId."") or die('crap'); //Adding an (int) will help avoid SQL errors } }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.