The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Foreach() problem
In admin/user.php I have inserted the following code to extract data from a custom table "memberinfo" and display using the makeinputcode() function of vbulletin.
PHP Code:
|
#2
|
|||
|
|||
It's the way mysql_fetch_array() works - it returns both a numerical and associative index for each column unless specified otherwise. You can change that block of code to:
PHP Code:
|
#3
|
||||
|
||||
add LIMIT 1 to the query.
|
#4
|
|||
|
|||
Quote:
|
#5
|
||||
|
||||
its adding more results, and he/she only want 1,. not 2,3,4,5...
or did i read the post wrong? |
#6
|
|||
|
|||
Quote:
|
#7
|
||||
|
||||
I (he!) want to step through all the fields in the array!
I started to use extract() then hard-code all the makeinputcode bits, then I though no, why not build an interface to the memberinfo table on the fly rather than hard code it. Foreach() looked a bettersolution than while() ... I'll try your suggestions. I was trying to use the vB functions but now I think I'd probably be better off just using plain PHP and mySQL so I understand the code better, no? I'm a bit new to PHP, trying hard ... Matthew |
#8
|
||||
|
||||
Nope
I get Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /[path]/user.php on line 314 |
#9
|
||||
|
||||
All fixed. thanks. I needed the MYSQL_ASSOC value!
Works now, thanks x 10^6 Matthew |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|