| |
|
|
| |
|
|
| |
|
Item Shop, Item Shop.. why art thou such a pain?
06.09.02, 08:07:53
|
|
|
|
Post #1 (permalink) |
|
|
| |
|
|
OK, afterlab's ItemShop 3.0 has been giving me nothing but trouble when I try and add things to it. I recently added several new item types to it (Materia and such), I coded what it should do for buying/selling/displaying etc. Changed the template files.
But when I try and buy one of my new items it comes up with this.
Database error in vBulletin 2.2.5:
Invalid SQL: UPDATE userfield SET ='Holy Matter' WHERE userid=1
mysql error: You have an error in your SQL syntax near '='Holy Matter' WHERE userid=1' at line 1
mysql error number: 1064
Date: Sunday 09th of June 2002 07:50:28 AM
Script: http://www.zcentralhq.com/forums/for...=Holy%20Matter
Referer: http://forums.zcentralhq.com/forums/itemshop.php?s=
I've trashed high and low over the itemshop.php file but I can't find the problem.
Quote:
<?php
error_reporting(7);
$templatesused = 'itemshop';
require('./global.php');
$pointfield="field8";
$weaponsfield="field9";
$armorfield="field10";
$itemfield="field11";
$materiafield="field12";
$eidolonfield="field13";
$revivalfield="field14";
$armfield="field16";
$pointss=$DB_site->query_first("SELECT $pointfield FROM userfield WHERE userid=$bbuserinfo[userid]");
$points = (int) $pointss[$pointfield];
$itemm=$DB_site->query_first("SELECT $weaponsfield FROM userfield WHERE userid=$bbuserinfo[userid]");
$itemdisplay = $itemm[$weaponsfield];
if(!$itemdisplay) {
$itemdisplay="No Item";
}
$itemm=$DB_site->query_first("SELECT $armorfield FROM userfield WHERE userid=$bbuserinfo[userid]");
$itemdisplay2 = $itemm[$armorfield];
if(!$itemdisplay2) {
$itemdisplay2="No Item";
}
$itemm=$DB_site->query_first("SELECT $itemfield FROM userfield WHERE userid=$bbuserinfo[userid]");
$itemdisplay3 = $itemm[$itemfield];
if(!$itemdisplay3) {
$itemdisplay3="No Item";
}
$itemm=$DB_site->query_first("SELECT $materiafield FROM userfield WHERE userid=$bbuserinfo[userid]");
$itemdisplay2 = $itemm[$materiafield];
if(!$itemdisplay4) {
$itemdisplay4="No Item";
}
$itemm=$DB_site->query_first("SELECT $eidolonfield FROM userfield WHERE userid=$bbuserinfo[userid]");
$itemdisplay2 = $itemm[$eidolonfield];
if(!$itemdisplay5) {
$itemdisplay5="No Item";
}
$itemm=$DB_site->query_first("SELECT $revivalfield FROM userfield WHERE userid=$bbuserinfo[userid]");
$itemdisplay2 = $itemm[$revivalfield];
if(!$itemdisplay6) {
$itemdisplay6="No Item";
}
$itemm=$DB_site->query_first("SELECT $armfield FROM userfield WHERE userid=$bbuserinfo[userid]");
$itemdisplay2 = $itemm[$armfield];
if(!$itemdisplay7) {
$itemdisplay7="No Item";
}
// Define weapons and points
$weapons = array("Air Racket" => "100",
"Blood Axe" => "140",
"Blood Sword" => "170",
"Brotherhood" => "510",
"Chaos Blade" => "660",
"Chaos Bow" => "330",
"Mythrill Sword" => "210",
"Ice Blade" => "400",
"Sidewinder" => "740",
"Ice Staff" => "1060",
"Trident" => "1472",
"Mythrill Rod" => "2000",
"Gold Blade" => "2459",
"Angel Sword" => "5530",
"Angel Staff" => "5530",
"Heavens Edge" => "9730");
//check weapons
foreach($weapons as $key => $value) {
if($itemdisplay==$key) {
$nxpts = $value;
}
}
// Define armor and points
$armor = array("Earth Armor" => "500",
"Magic Armor" => "830",
"Panacea Armor" => "1045",
"Fire Tunic" => "1200",
"Demon Mail" => "1450",
"Rainbow Robe" => "2000",
"Angel Armor" => "5530");
//check armor
foreach($armor as $key => $value) {
if($itemdisplay2==$key) {
$nxpts2 = $value;
}
}
// Define arm gear and points
$armgear = array("Boxing Glove" => "500",
"Iron Armlet" => "730",
"Mythrill Armlet" => "920",
"Water Bracelet" => "1490",
"Gaia Gloves" => "2763",
"Demon Wrist" => "3650",
"Angel Bracelet" => "3850",
"Holy Gloves" => "4900",
"Holy Armlet" => "5950");
//check arm gear
foreach($armgear as $key => $value) {
if($itemdisplay7==$key) {
$nxpts7 = $value;
}
}
// Define materia and points
$materia = array("Cure" => "500",
"Fire" => "500",
"Thunder" => "500",
"Ice" => "500",
"Quake" => "500",
"Flare" => "750",
"Comet" => "850",
"Time" => "900",
"Aqua" => "950",
"Enemy Skill" => "1200");
//check materia
foreach($materia as $key => $value) {
if($itemdisplay4==$key) {
$nxpts4 = $value;
}
}
// Define eidolon and points
$eidolon = array("GemStone" => "1111",
"Blood Matter" => "1200",
"Blue Matter" => "1400",
"Aqua Matter" => "1600",
"Dark Matter" => "1700",
"Terra Matter" => "2059",
"Demon Matter" => "3050",
"Holy Matter" => "5000");
//check eidolon
foreach($eidolon as $key => $value) {
if($itemdisplay5==$key) {
$nxpts5 = $value;
}
}
// Define items and points
$items = array("Antidote" => "50",
"Hi Potion" => "130",
"Tent" => "220",
"Mega Potion" => "490",
"Aura Stone" => "750",
"Mega Elixir" => "1200",
"Holy War" => "7890");
//check items
foreach($items as $key => $value) {
if($itemdisplay3==$key) {
$nxpts3 = $value;
}
}
// Define restorative and points
$ritems = array("Phoenix Down" => "500",
"Mog Esscence" => "5650");
//check restorative
foreach($ritems as $key => $value) {
if($itemdisplay6==$key) {
$nxpts6 = $value;
}
}
(the loop's etc go here)
|
^I can't see what's wrong in that, so can someone PLEASE Help me? Thanx! |
______________________________________
Arielle
Aerith_Freak | aerithfreak | Ethereal
Former Site Manager and Forum Administrator of Final Fantasy Republic 2002-2005
|
|
|
|
|
|
| It may be your profile fields. Make sure that the field list is just right. If you need any further help just pm me and I'll come over to fix it. |
______________________________________
|
|
|
|
|
|
::sighs::
This is a known hack to screw up, don't use it, instead use Mewtwo's Itemshop v5.3, which can be found on vb.org. It works flawlessly. |
______________________________________
Position: Economics Officer | Clan: Kilika 9 | FFR Graphics Club: Leader
|
|
|
|
|
|
| Nope. That's sorta flawed too. Lol. I took care of this and am writing a new version of afterlab's. |
|
|
|
|
|
|
well, there is no field
UPDATE userfield SET ='Holy Matter' WHERE userid=1
should be
UPDATE userfield SET fieldx='Holy Matter' WHERE userid=1
check the buy function.
Quote:
Originally posted by Anthony
Nope. That's sorta flawed too. Lol. I took care of this and am writing a new version of afterlab's.
|
most errors come from people who don't follow the instructions correctly.
Giving support takes time and can get very annoying. You'll see what i mean when you release it. 
I thought i had taken care of every error too, and it works perfectly for me, no errors, no problems, but people keep popping up with different things, some of which are caused by incorrect installation and/or other hacks. |
______________________________________

Last edited by rake : 06.09.02 at 12:27:32.
|
|
|
|
|
|
| Here comes Mew to save the day. Lol. |
|
|
|
|
|
|
Very true, Mewtwo. I've also stated only 100 so times that I no longer support this hack, and no longer allow use of it.
My Item Shop 3.0 worked but I simply took it down because I didn't want anyone else to use it (As I do with most hacks I make). |
______________________________________

From the founder of Final Fantasy Republic
Gamertag Nation
|
|
|
|
|
|
| No doubt, I totally agree. I will provide support for the new itemshop but it will only last for so long. Like afterlab, I will only support it as long as I use it. |
|
|
|
|
| |