Database error after adding premium currency

So i has trying to add a premium currency to my site, and guess what? Isn't working!
It just gives a "Database error 1054 - Unknown column 'premiumcost' in 'field list'

".

I did the mod everything right (as i remember), so what's wrong?

 
Last edited by a moderator:
If it's giving that error, something is spelled wrong somewhere. The script is trying to call a variable that doesn't exist.What page does this happen on? What does the code look like?

 
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"

 
Last edited by a moderator:
Oh.
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.

 
Last edited by a moderator:
I just followed the tutorial myself and didn't get that error. What are you doing when you get the error? Does it appear on the index or when you click a button? It would help to know what triggers it.

 
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.

 
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.

 
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.

 
Last edited by a moderator:
I think i fixed everything.
I'll see.

Edit: Stills....

Edit³: Looks like that i fixed it by adding "premiumcost" in PhpMyAdmin and did it's attributes as same of "cost".

 
Last edited by a moderator:
I think i'll forget Phantom Quartz untill i have an official coder (and i can't afford one sadly). So the Phantom Quartz adoptables i have made must wait.

 
If you're talking about my site, it's a premium currency that can be used to buy premium pets and items.
But about gemology, it's a transparent type of quartz.

 
Last edited by a moderator:
Back
Top