The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
invalid argument
im getting invalid argument for some reason:
heres the error Quote:
PHP Code:
|
#2
|
||||
|
||||
are you sure the variable $question['answer'] is an array?
it has to be one |
#3
|
||||
|
||||
well isnt fetch_array making the results into an array?
|
#4
|
||||
|
||||
$question is an array, but you are using $question['answer'] as argument
|
#5
|
||||
|
||||
it seems like you should just don't use foreach at all, and just use the fetch array loop
|
#6
|
||||
|
||||
but it will only display one answer for each question even though there might be for five or six of them.
|
#7
|
||||
|
||||
as i said, you have to make sure what type of variable is $question['answer']
if it's an array you can use foreach, if not, then you have tu use something else to spread it on your board. I can just explain what lead to the error, not what exactly the vars are |
#8
|
||||
|
||||
could u give me a suggestion on how to make it that for each answer?
plz oh mighty php intelligent one |
#9
|
||||
|
||||
well, personally i'd put the answers into an array, and then serialize that array when storing into the db.
later when you catch it, you have to unserialize it again. or you can use the way vb devs did it with poll questions by seperating the strings via ||| and then using implode and explode functions. the serialize function should be explained in the tips and trix forums here, the implode version is used often in vb and should be quite selfexplaining you may also look up php.net for infos about. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|