Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- $a = array(1229, 1230, 731, 738, 1231, 735, 734, 2171, 736, 750, 751, 4135, 3840, 4134,2205, 1225, 1233);
- error_reporting(E_WARNING);
- $mysql_host = "server";
- $mysql_database = "db";
- $mysql_user = "username"
- $mysql_password = "pwd";
- $conn = mysql_connect($mysql_host, $mysql_user, $mysql_password);
- if (!$conn)
- {
- exit("Connection failed: " . $conn);
- }
- echo("Connection succeeded.");
- $res = mysql_select_db($mysql_database);
- if (!$res)
- {
- exit("Couldn't select database.");
- }
- foreach ($a as $v) {
- mysqli_query($conn,"UPDATE Food SET Maincat = 2 WHERE Number = '$v'");
- }
- mysqli_close($conn);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment