Jump to content
  • 0
Sign in to follow this  
N e s s

cora cp users

Question

how to fix this error? 

A Database Error Occurred

Error Number: 1054

Unknown column 'item_db.type' in 'where clause'

SELECT * FROM ((SELECT * FROM (`tcp_shop`) JOIN `item_db2` ON `item_db2`.`id`=`tcp_shop`.`item_id` WHERE `item_db.type`=5) UNION (SELECT * FROM (`tcp_shop`) JOIN `item_db` ON `item_db`.`id`=`tcp_shop`.`item_id` WHERE `item_db.type`=5)) a ORDER BY `name_japanese` asc LIMIT 0, 10

Filename: /home/brynhild/application/models/mshop.php

Line Number: 60

 

i got this error when i click consumable, weapon, costumes, pet, cards, and misc category in cash shop :( help me for those who are using cora cp :(

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi. The problem here is that in the shop controller, the `type` fields are prefixed with the `item_db` table name while in the model it's also prefixed with whatever db you choose. So if you are using item_db, it would add an item_db string string in the field name which will result into `item_db`.`item_db.type` thus creating an error in the sql statement.
 
You can fix this by editing line 24-51 of the application/controllers/shop.php file. In those lines you'll find this piece of code:
 

if(isset($_GET['cat'])) {            switch($_GET['cat']) {                case 'consume':                    $cond = array('index'=>'item_db.type','val'=>array(0,2,11,18)); break;                case 'head':                    $cond = array('index'=>'equip_locations','val'=>array(1,256,257,512,513,768,769)); break;                case 'weapon':                    $cond = array('index'=>'item_db.type','val'=>array(5)); break;                case 'shield':                    $cond = array('index'=>'equip_locations','val'=>array(32)); break;                case 'armor':                    $cond = array('index'=>'equip_locations','val'=>array(16)); break;                case 'robe':                    $cond = array('index'=>'equip_locations','val'=>array(4)); break;                case 'shoes':                    $cond = array('index'=>'equip_locations','val'=>array(64)); break;                case 'accessories':                    $cond = array('index'=>'equip_locations','val'=>array(8,128,136)); break;                case 'pets':                    $cond = array('index'=>'item_db.type','val'=>array(7,8)); break;                case 'cards':                    $cond = array('index'=>'item_db.type','val'=>array(6)); break;                case 'costumes':                    $cond = array('index'=>'equip_locations','val'=>array(1024,2048,3072,4096,5120,6144,7168,8192));                case 'misc':                    $cond = array('index'=>'item_db.type','val'=>array(3,10)); break;            }        }

For each case where the 'index' is `item_db.type`, remove the item_db so you'll only be left with `type`. Unfortunately there's no official patch for this, so a fix for now will have to be done like this.

On the good note, we have already restarted development for the second phase of CORA's beta.

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Answer this question...

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

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.