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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.