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:
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user