Announcement

Collapse
No announcement yet.

makeinputcode() help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • makeinputcode() help

    I see many places in the admin CP of vb where code is created in PHP by using the makeinputcode(x,x,x) command. I searched PHP.net for makeinputcode and could not find a single thing, so I figured my next best option would be here.

    Here's what I'm trying to accomplish:

    Select from a table in my db a listing of descriptions with a query similar to: SELECT table.ID, table.description FROM tablename ... It would return a list similar to this:

    1 Description1
    2 Description2
    3 Description4
    etc....

    What I'd like to do is use this to populate a drop-down menu with code like:

    <option value="1">Description1
    <option value="2">Description2
    and so on and so forth...

    So is there a makeoptioncode() function that I could use with a while statement? If so how would I implement this...

    Thanks in advance!
    Matt Baskett
    www.torquecentral.com

  • #2
    Nevermind I found it myself.... after some digging through admin/user.php

    makechoosercode() was what I was looking for and actually does the autopopulate quite nicely (provided the table name,id, and desc field follow a simple pattern:

    id = tablename+"id"
    description filed MUST = "title"

    )

    Anyway... found out what I needed, and got my code working...

    Cheers!
    Matt Baskett
    www.torquecentral.com

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X