Jump to content

Database error after adding premium currency

Recommended Posts

You can delete (called "drop" in phpMyAdmin) the unneeded ones by selecting "unique" on one of the columns in the structure tab.

It appears that you have the tables set up wrong. I'm assuming you're following this tutorial, and the table should be set up like:

premiumcurrency | Phantom Quartz

I recommend that you try installing it again to make sure you did everything right. When you add the SQL query in adopts_settings, make sure you have it like:


INSERT INTO `adopts_settings`(`name`, `value`) VALUES ('premiumcurrency''Phantom Quartz')

After reading through, that should fix the problem and you shouldn't have to change anything else.


If you're sure that the table is the only problem, then you can just drop the first and last row (leave the middle one!) and change "your currency name" to "Phantom Quartz"

Edited by Dinocanid
Link to comment
Share on other sites

I'll also edit the "phantomquartz" stuff on my files to "premiumcurrency".
Will take time but i think that'll work.

Edit: Did everything but it stills have the "Database error 1054 - Unknown column 'premiumcost' in 'field list'". I still don't know what's happening.

Edited by LuciBeingLuci
Link to comment
Share on other sites

I see. Did you add a "premiumcost" column to table adopts_adoptables? If not, that's a contributor to your problem. Then in admincp->adopts.php, make sure you change this line under public function add():

$mysidia->db->insert("adoptables", array("id" => NULL, "type" => $mysidia->input->post("type"), "class" => $mysidia->input->post("class"), "description" => $mysidia->input->post("description"), "eggimage" => $eggimage, "whenisavail" => $mysidia->input->post("cba"),
				                                     "alternates" => $mysidia->input->post("alternates"), "altoutlevel" => $mysidia->input->post("altoutlevel"), "altchance" => $mysidia->input->post("altchance"), "shop" => $mysidia->input->post("shop"), "cost" => $mysidia->input->post("cost")));

to this:

$mysidia->db->insert("adoptables", array("id" => NULL, "type" => $mysidia->input->post("type"), "class" => $mysidia->input->post("class"), "description" => $mysidia->input->post("description"), "eggimage" => $eggimage, "whenisavail" => $mysidia->input->post("cba"),
				                                     "alternates" => $mysidia->input->post("alternates"), "altoutlevel" => $mysidia->input->post("altoutlevel"), "altchance" => $mysidia->input->post("altchance"), "shop" => $mysidia->input->post("shop"), "cost" => $mysidia->input->post("cost"), "premiumcost" => $mysidia->input->post("premiumcost")));

(Make sure you do the same for public function edit() too).


In admincp->view->adoptview.php, make sure you have the text field properly set up like:

$shopSettings->add(new Comment("Premium Price: ", FALSE));
		$shopSettings->add(new TextField("premiumcost", 0, 10));


Finally, in classes->class_adoptable.php, you need to add this to the list of protected variables:

protected $premiumcost;

and this with the other public functions:

public function getPremiumcost(){
	    return $this->premiumcost;

I'm not sure if you did all this, but it's necessary for what you're trying to do.

Link to comment
Share on other sites

7 hours ago, LuciBeingLuci said:

It appears when i try to add an adoptable that costs premium currency.
Also...i can't put a premium currency name, so i wrote the "Phantom Quartz" on the sidebar myself.

@LuciBeingLuci: Can you send me a copy of your sql tables as well as the attributes of each table? I think I can find the issue. However I will need some explaining of what each attribute does.

Edited by Boltgreywing
Link to comment
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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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