1
mirror of https://github.com/jakejarvis/spoons.git synced 2025-10-22 20:34:29 -04:00

change all database stuff to MySQLi

This commit is contained in:
2017-07-16 12:43:57 -04:00
parent c89c6821e0
commit 438a9db194
9 changed files with 139 additions and 133 deletions

View File

@@ -4,11 +4,11 @@ include('db_connect.php');
include('functions.php');
if($_POST) {
$order = getHighestOrderNum() + 1;
$order = getHighestOrderNum($conn) + 1;
for($i = 0; $i < $_POST['num']; $i++) {
if($_POST['first-' . $i] != "") {
if(!$_POST['staff-' . $i]) $_POST['staff-' . $i] = 0;
mysql_query('INSERT INTO spooners (first, last, order_num, staff) VALUES ("' . mysql_real_escape_string($_POST['first-' . $i]) . '", "' . mysql_real_escape_string($_POST['last-' . $i]) . '", ' . $order . ', ' . mysql_real_escape_string($_POST['staff-' . $i]) . ')') or die(mysql_error());
mysqli_query($conn, 'INSERT INTO spooners (first, last, order_num, staff) VALUES ("' . mysqli_real_escape_string($conn, $_POST['first-' . $i]) . '", "' . mysqli_real_escape_string($conn, $_POST['last-' . $i]) . '", ' . $order . ', ' . mysqli_real_escape_string($conn, $_POST['staff-' . $i]) . ')') or die(mysqli_error($conn));
$order++;
}
}