[PHP] Adding a sql to ArcEmu DB - MySQL Bug menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    facka138b's Avatar Member
    Reputation
    10
    Join Date
    Mar 2008
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [PHP] Adding a sql to ArcEmu DB - MySQL Bug

    Adding a sql to ArcEmu DB

    Problem:
    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1','1','1','1','1','1','1','1','1','','1','1','1','1','','','','','','1','','', '' at line 1

    Here is my php file:


    <?php
    $con = mysql_connect("localhost","root","root");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }

    mysql_select_db("1world", $con);

    $sql="INSERT INTO items VALUES ('$_POST[entry]','$_POST[class]','$_POST[subclass]','$_POST[field4]','$_POST[name1]','$_POST[displayid]','$_POST[quality]','$_POST[flags]','$_POST[buyprice]','$_POST[sellprice]','$_POST[inventorytype]','$_POST[allowableclass]','$_POST[allowablerace]','$_POST[itemlevel]','$_POST[requiredlevel]','$_POST[RequiredSkill]','$_POST[RequiredSkillRank]','$_POST[RequiredSpell]','$_POST[RequiredPlayerRank1]','$_POST[RequiredPlayerRank2]','$_POST[RequiredFaction]','$_POST[RequiredFactionStanding]','$_POST[Unique]','$_POST[maxcount]','$_POST[ContainerSlots]','$_POST[stat_type1]','$_POST[stat_value1]','$_POST[stat_type2]','$_POST[stat_value2]','$_POST[stat_type3]','$_POST[stat_value3]','$_POST[stat_type4]','$_POST[stat_value4]','$_POST[stat_type5]','$_POST[stat_value5]','$_POST[stat_type6]','$_POST[stat_value6]','$_POST[stat_type7]','$_POST[stat_value7]','$_POST[stat_type8]','$_POST[stat_value8]','$_POST[stat_type9]','$_POST[stat_value9]','$_POST[stat_type10]','$_POST[stat_value10]','$_POST[dmg_min1]','$_POST[dmg_max1],'$_POST[dmg_type1]','$_POST[dmg_min2]','$_POST[dmg_max2]','$_POST[dmg_type2]','$_POST[armor]','$_POST[holy_res]','$_POST[fire_res]','$_POST[nature_res]','$_POST[frost_res]','$_POST[shadow_res]','$_POST[arcane_res]','$_POST[delay]','$_POST[ammo_type]','$_POST[range]','$_POST[spellid_1]','$_POST[spelltrigger_1]','$_POST[spellcharges_1]','$_POST[spellcooldown_1]','$_POST[spellcategory_1]','$_POST[spellcategorycooldown_1]','$_POST[spellid_2]','$_POST[spelltrigger_2]','$_POST[spellcharges_2]','$_POST[spellcooldown_2]','$_POST[spellcategory_2]','$_POST[spellcategorycooldown_2]','$_POST[spellid_3]','$_POST[spelltrigger_3]','$_POST[spellcharges_3]','$_POST[spellcooldown_3]','$_POST[spellcategory_3]','$_POST[spellcategorycooldown_3]','$_POST[spellid_4]','$_POST[spelltrigger_4]','$_POST[spellcharges_4]','$_POST[spellcooldown_4]','$_POST[spellcategory_4]','$_POST[spellcategorycooldown_4]','$_POST[spellid_5]','$_POST[spelltrigger_5]','$_POST[spellcharges_5]','$_POST[spellcooldown_5]','$_POST[spellcategory_5]','$_POST[spellcategorycooldown_5]','$_POST[bonding]','$_POST[description]','$_POST[page_id]','$_POST[page_language]','$_POST[page_material]','$_POST[quest_id]','$_POST[lock_id]','$_POST[lock_material]','$_POST[sheathID]','$_POST[randomprop]','$_POST[randomsuffix]','$_POST[block]','$_POST[itemset]','$_POST[MaxDurability]','$_POST[ZoneNameID]','$_POST[mapid]','$_POST[bagfamily]','$_POST[TotemCategory]','$_POST[socket_color_1]','$_POST[unk201_3]','$_POST[socket_color_3]','$_POST[unk201_5]','$_POST[socket_color_3]','$_POST[unk201_7]','$_POST[socket_bonus]','$_POST[GemProperties]','$_POST[ReqDisenchantSkill]','$_POST[ArmorDamageModifier]','$_POST[itemstatscount]')";

    if (!mysql_query($sql,$con))
    {
    die('Error: ' . mysql_error());
    }
    echo "ItemCraft: Weapon succesfully created!";

    mysql_close($con);
    ?>

    [PHP] Adding a sql to ArcEmu DB - MySQL Bug
  2. #2
    Laniax's Avatar Active Member
    Reputation
    47
    Join Date
    Feb 2008
    Posts
    187
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please add the SQL file that your trying to add.

  3. #3
    Kiev's Avatar Contributor
    Reputation
    288
    Join Date
    Nov 2007
    Posts
    1,819
    Thanks G/R
    0/4
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He isn't trying to add a SQL file... hes inserting a SQL Command. Hence the "INSERT into items", it could be a error in the table, maybe one too many columns and what not.




  4. #4
    Hellgawd's Avatar Member
    Reputation
    710
    Join Date
    Jun 2007
    Posts
    2,480
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please put all that PHP code onto new lines, it's stretching my page WAY too far.
    As for the error, there could be a whole bunch of things causing it, depending on your script and what variables are being submitted ect.

  5. #5
    Maikash2's Avatar Member
    Reputation
    1
    Join Date
    May 2007
    Posts
    33
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change this:
    Code:
    if (!mysql_query($sql,$con))
    {
    die('Error: ' . mysql_error());
    }
    to this...
    Code:
    if (!mysql_query($sql,$con))
    {
    $error = 'Error: '. mysql_error() .'
    SQL: '. $sql;
    die($error);
    }
    Just temporarily, cus I've noticed that sometimes MySQL's errors aren't very helpful for me at least.. And then just post what you get here.

Similar Threads

  1. TrinityCore 3.3.5a Repack Many Scripted Added [ C++ & SQL ]
    By JadaDev in forum WoW EMU General Releases
    Replies: 13
    Last Post: 06-01-2023, 07:04 PM
  2. [Database] Quick question on the SQL Database (ARCEmu)
    By thesixth in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 09-18-2010, 03:48 PM
  3. Character and Logon.sql for ArcEMU 2075+
    By Zawisz in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 07-08-2009, 08:41 AM
  4. *HELP* ArcEmu Core strange bug ?
    By thegame240 in forum WoW EMU Questions & Requests
    Replies: 15
    Last Post: 10-22-2008, 09:34 AM
  5. [[mysql bugged dont download][Release]Wowemulator Repack 7.0
    By vittwow in forum WoW EMU General Releases
    Replies: 6
    Last Post: 08-08-2008, 10:43 AM
All times are GMT -5. The time now is 07:01 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search