No announcement yet.

Is it possible to access an existing (mysql) connection ?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to access an existing (mysql) connection ?

    I would like to display some stuff using php, as part of the forums page(s). I am undecided if I shall be implementing this as part of the templates structure. I have a php script that opens a new connection to the database.

    Is it possible to use an existing database connection handle that vb uses for displaying its pages ? If so, how can I implement this ? A short example will be gratefully appreciated.

  • #2
    I think this belongs in the php section.
    NXSupport Admin


    • #3
      Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
      Change CKEditor Colors to Match Style (for 4.1.4 and above)

      Steve Machol Photography

      Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


      • #4
        If you run mysql_query() it automatically uses the last connection used by a query. Is it that what you mean?


        • #5
          Or use..

          mysql_query("query", $connection);

          Assuming you've defined $connection
          "63,000 bugs in the code, 63,000 bugs, you get 1 whacked with a service pack, now there's 63,005 bugs in the code."
          "Before you critisize someone, walk a mile in their shoes. That way, when you critisize them, you're a mile away and you have their shoes."
          Utopia Software - Current Software: Utopia News Pro (news management system)


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