View Single Post
  #4  
Old 12-29-2014, 06:54 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,635
IntoRain is on a distinguished road
Default

Quote:
Originally Posted by Abronsyth View Post
It's driving me nuts, haha XD ((Took my 6 months to learn html and css, taken me 3+ years and still haven't learned php...someday I'll be able to solve these issues. Soooome day.)).
Haha php is a whole programming language, it's normal to take longer to learn! You gotta go step by step

In this part:

Inventoryview.php
PHP Code:
$adoptable->add(new Option($adopt->getValue(), $adopt->getKey())); 
Do you have any idea why the value and the key are inverted? It's basically creating an option with the text shown to the user as $adopt->getValue() (the adoptable's id) and the text sent to the server as $adopt->getKey() (the adoptable's name).
Doing this should fix it:

PHP Code:
//to show the id
$adoptable->add(new Option($adopt->getValue(), $adopt->getValue()));

//or to show the name instead
$adoptable->add(new Option($adopt->getKey(), $adopt->getValue())); 
But I don't know why it was inverted in the first place, so I don't know if there's any other system associated with that that might break...
__________________


asp.net stole my soul.

Last edited by IntoRain; 12-29-2014 at 06:58 PM.
Reply With Quote