Jump to content

AcceptOrder Hook and SQL database connection


Recommended Posts




Im using an "AcceptOrder" hook and at the moment im able to get client username (firstname field) from "orderid" passed in this hook.



What i want to achieve is setting the corresponding username to a private group inside my forum software.

In order to do this i need to connect to my forum database (im using one for Whmcs and a separate one for forum)


Tried using mysql_connect and mysqli to connect to my forum database: everything fails!

Im using same codes in other scripts and works fine


Perhaps creating a second connection inside an hook isnt allowed?




Link to comment
Share on other sites



You could even connect to 100 different database in your hook file. Are you sure that you are using the right syntax and that the database of your forum is on localhost? In case your forum is running on a different server probably you can't connect to database since most of times remote access disabled for security reasons.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated