PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Old November 11th, 2012, 03:47 PM
Sleeping Troll Sleeping Troll is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 5 Sleeping Troll User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 6 m 20 sec
Reputation Power: 0
Script is not updating database... no error.

This is the script:
PHP 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'";
echo 
"$query";
$items mysqli_query($mysqli,$query);
$item $items->fetch_array(MYSQLI_NUM);
print_r ($item);
$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);
?>


What am I missing here?

Reply With Quote
Old November 13th, 2012, 09:13 AM
DavidMR's Avatar
DavidMR DavidMR is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Galway
Posts: 1,437 DavidMR User rank is Lance Corporal (50 - 100 Reputation Level)DavidMR User rank is Lance Corporal (50 - 100 Reputation Level)DavidMR User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Month 3 Days 20 h 56 m 48 sec
Reputation Power: 9
echo your insert query and see what it says?
I also saw
PHP Code:
echo "$query"


the quotes are not needed
__________________
When I die, I want to go peacefully like my Grandfather did, in his sleep -- not screaming, like the passengers in his car.

Reply With Quote
Old November 13th, 2012, 01:27 PM
Sleeping Troll Sleeping Troll is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 5 Sleeping Troll User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 6 m 20 sec
Reputation Power: 0
Better I should paste my query into phpmyadmin and see what it says... BINGO! error around description...

Thank you for your interest!

Reply With Quote
Closed Thread

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Script is not updating database... no error.


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap