Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. $warehouse = @$_POST['wh'];
  2. switch($button){
  3. case 'Submit':
  4. if(@$_POST['wh']){
  5. $warehouse = @$_POST['wh'];
  6. $length = count($warehouse);
  7. for ($i = 0; $i < $length; $i++){
  8. //echo '<br>'.$warehouse[$i];
  9.  
  10.  
  11. }
  12.  
  13. $consult = "SELECT * FROM contact_info WHERE ";
  14. for ($i = 0; $i < $length; $i++){
  15. $consult = $consult . "warehouse='$warehouse[$i]'";
  16. if(!$i+1 == $length){
  17. $consult = $consult . " OR ";
  18. }
  19.  
  20. }
  21. echo '<br>'.$length.'<br>';
  22. print_r ($consult);
  23. $response = mysqli_query($connection, $consult);
  24. if($response){
  25. $registry = mysqli_affected_rows($connection);
  26.  
  27. if($registry > 1){
  28. echo '<br><table width="800" align="center" border="2" cellspacing="1" cellpadding="1">
  29. <form action="index.php" method="post" >
  30. <tr>
  31. <td align="center"><strong>Warehouse</strong></td>
  32. <td align="center"><strong>Name</strong></td>
  33. <td align="center"><strong>Lastname</strong></td>
  34. <td align="center"><strong>Phone</strong></td>
  35. <td align="center"><strong>I-net</strong></td>
  36. <td align="center"><strong>E-mail</strong></td>
  37. </tr>';
  38.  
  39. while($registry = mysqli_fetch_array($response, MYSQLI_ASSOC)){
  40. echo '<form action="index.php" method=post >
  41. <tr>
  42. <td div align="center">'.$registry['warehouse'].'
  43. <td div align="center">'.$registry['name'].'
  44. <td div align="center">'.$registry['lastname'].'
  45. <td div align="center">'.$registry['phone'].'
  46. <td div align="center">'.$registry['inet'].'
  47. <td div align="center">'.$registry['email'].'
  48. </tr>';
  49.  
  50.  
  51. }
  52. echo '</form>';
  53. echo '
  54. </form>
  55. </table>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement