SleepingTroll Posted November 11, 2012 Share Posted November 11, 2012 Here's my code: <?php $description = "Switchblade"; /*$_REQUEST['Description'];*/ $userid = "1"; /*$_REQUEST['userid'];*/ $mysqli = new mysqli("localhost", "****", "****", "****"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT username FROM phpbb_users WHERE user_id = '$userid'"; $username = mysqli_query($mysqli,$query); $name = $username->fetch_array(MYSQLI_NUM); $query = "SELECT lat, lng, alt FROM uwl_userlocation WHERE user_id = '$userid'"; $location = mysqli_query($mysqli,$query); $coords = $location->fetch_array(MYSQLI_NUM); $query = "SELECT * FROM uwl_items WHERE Description = '$description' AND user_id = '0'"; $items = mysqli_query($mysqli,$query); $item = $items->fetch_array(MYSQLI_NUM); $query = " INSERT INTO `uwl_items` ( `Owner`, `Description, `Amount`, `lat`, `lng`, `alt`, `Health`, `Strength`, `Dexterity`, `Intelligence`, `Range`, `Duration`, `Reliability`, `Start`, `Health Req`, `Strength Req`, `Dexterity Req`, `Intelligence Req`, `Time Req` ) VALUES ('$userid', '$item[2]', '$item[3]', '$coords[0]', '$coords[1]', '$coords[2]', '$item[7]', '$item[8]', '$item[9]', '$item[10]', '$item[11]', '$item[12]', '$item[13]', '$item[14]', '$item[15]', '$item[16]', '$item[17]', '$item[18]', '$item[19]' )"; mysqli_query($mysqli,$query); ?> Where is it going wrong? Quote Link to comment https://forums.phpfreaks.com/topic/270572-database-not-updating-no-error/ Share on other sites More sharing options...
Pikachu2000 Posted November 11, 2012 Share Posted November 11, 2012 You don't know if there are any database errors or not. You aren't checking for them by using mysqli_error() if any of the queries fail. Quote Link to comment https://forums.phpfreaks.com/topic/270572-database-not-updating-no-error/#findComment-1391749 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.