Thread: MySQL + Arrays?
View Single Post
  #1  
Old 09-29-2011, 03:21 PM
PTGigi's Avatar
PTGigi PTGigi is offline
Crazily Friendly~HoF
 
Join Date: Jul 2009
Location: Somewhere >.>
Posts: 370
Gender: Female
Credits: 35,814
PTGigi
Default MySQL + Arrays?

Right, so having an issue here >.> I have two arrays I'm trying to make (one of which is working fine :3) but the second one seems to be running into an issue with the fact I'm trying to call an array from a MySQL cell.

So basically this MySQL cell has the phrase "3,4,5,6" (no quotes). It is set to a variable $adoptid which I'm trying to put in an array. Problem is it treats the whole variable as an array. So instead of using '3', '4', '5', and '6' as variables in the array it treats "3,4,5,6" as a variable in the array. (if that just made sense...)

Does anyone know a way I can put values into a MySQL cell and then pick one randomly from an array?

Trying to do something like:
PHP Code:
$variable = array($adoptid); 
Fails because of the issue mentioned in the second paragraph D: And trying to put "array(3,4,5,6)" in a cell fails as well D: (I don't even know what it does but basically it picks from the characters o-o (ie a,r,r,a,y, etc))
__________________


"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo
My Adoptables|Nuzlocke Webcomic
Reply With Quote