Jump to content

Database Not Updating, No Error...


SleepingTroll

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/270572-database-not-updating-no-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.