joelwe

Untitled

Mar 28th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <html>
  2. <body>
  3. <?php
  4. $a = array(1229, 1230, 731, 738, 1231, 735, 734, 2171, 736, 750, 751, 4135, 3840, 4134,2205, 1225, 1233);
  5. error_reporting(E_WARNING);
  6.  
  7. $mysql_host = "server";  
  8. $mysql_database = "db";
  9. $mysql_user = "username"
  10. $mysql_password = "pwd";
  11.  
  12. $conn = mysql_connect($mysql_host, $mysql_user, $mysql_password);
  13. if (!$conn)
  14. {
  15.   exit("Connection failed: " . $conn);
  16. }
  17.  
  18.  echo("Connection succeeded.");
  19.  
  20.  $res = mysql_select_db($mysql_database);
  21.  
  22.  if (!$res)
  23.  {
  24.    exit("Couldn't select database.");
  25.  }
  26.  
  27. foreach ($a as $v) {
  28.     mysqli_query($conn,"UPDATE Food SET Maincat = 2 WHERE Number = '$v'");
  29. }
  30.  
  31. mysqli_close($conn);
  32. ?>
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment