diff --git a/edit_game.php b/edit_game.php index bd1a6f3..8919f17 100755 --- a/edit_game.php +++ b/edit_game.php @@ -18,12 +18,12 @@ if (LOGIN!="") { $edit_second_bill=money_to_bill($_POST['edit_second_bill']); $edit_third_id=$_POST['edit_third_id']; $edit_third_bill=money_to_bill($_POST['edit_third_bill']); - mysql_query("UPDATE `games` SET `scoregame` = '$edit_scoregame', `location` = '$edit_location', `datetime` = '$edit_datetime', `player` = '$edit_player', `base_bill` = '$edit_base_bill', `first_id` = '$edit_first_id', `first_bill` = '$edit_first_bill', `second_id` = '$edit_second_id', `second_bill` = '$edit_second_bill', `third_id` = '$edit_third_id', `third_bill` = '$edit_third_bill' WHERE `games`.`id` =$EDIT_ID LIMIT 1 ; ",DB); + mysqli_query($db, "UPDATE `games` SET `scoregame` = '$edit_scoregame', `location` = '$edit_location', `datetime` = '$edit_datetime', `player` = '$edit_player', `base_bill` = '$edit_base_bill', `first_id` = '$edit_first_id', `first_bill` = '$edit_first_bill', `second_id` = '$edit_second_id', `second_bill` = '$edit_second_bill', `third_id` = '$edit_third_id', `third_bill` = '$edit_third_bill' WHERE `games`.`id` =$EDIT_ID LIMIT 1 ; "); } if (TO_DO=="new_game") { - $query=mysql_query("SELECT `location` , `datetime` , `player` , `base_bill` , `first_id` , `first_bill` , `second_id` , `second_bill` , `third_id` , `third_bill` FROM `games` ORDER BY `games`.`id` DESC LIMIT 0 , 1",DB); - $data=mysql_fetch_row($query); + $query=mysqli_query($db, "SELECT `location` , `datetime` , `player` , `base_bill` , `first_id` , `first_bill` , `second_id` , `second_bill` , `third_id` , `third_bill` FROM `games` ORDER BY `games`.`id` DESC LIMIT 0 , 1"); + $data=mysqli_fetch_row($query); $hit=0; if ($data){ foreach($data as $field) { @@ -33,9 +33,10 @@ if (LOGIN!="") { } else $hit=1; if ($hit) { - mysql_query("INSERT INTO `games` ( ) VALUES ( );",DB); - $query=mysql_query("SELECT `id` FROM `games` ORDER BY `games`.`id` DESC LIMIT 0 , 1",DB); - $data=mysql_fetch_row($query); + mysqli_query($db, "INSERT INTO `games` ( `location`, `datetime`, `player`, `base_bill`, `first_id`, `first_bill`, `second_id`, `second_bill`, `third_id`, `third_bill` ) VALUES ( 'Bei Wem?', '1989-10-03 12:00:00', '', '200', '0', '0', '0', '0', '0', '0' );"); + echo "HERE" . mysqli_error($db); + $query=mysqli_query($db, "SELECT `id` FROM `games` ORDER BY `games`.`id` DESC LIMIT 0 , 1"); + $data=mysqli_fetch_row($query); $EDIT_ID=$data[0]; } else { @@ -45,16 +46,16 @@ if (LOGIN!="") { } if ($EDIT_ID) { - $query=mysql_query("SELECT * FROM `games` WHERE `id` = $EDIT_ID LIMIT 0 , 1",DB); - $data =mysql_fetch_array($query); + $query=mysqli_query($db, "SELECT * FROM `games` WHERE `id` = $EDIT_ID LIMIT 0 , 1"); + $data =mysqli_fetch_array($query); $BODY.='