The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
Sorry, misread it, it was a long and frustrating Saturday. Anyway, I figured the problem out... a different developer polluted the code with another DB connection because he didn't realize that the global.php included a database connection. Thanks though, and sorry for the little snap. Like I said, was a long Saturday. :erm:
|
#12
|
|||
|
|||
I am having the same error as Cryo, and if someone might have a suggestion on what could be wrong here I would be appreciative. I had been creating threads remotely using the build_new_post. I have since upgraded to 3.7.2, and that function does not work anymore. I have been trying to follow the instructions given in this thread, but running into the following error:
Fatal error: Database object is not an object in [path]/includes/class_dm.php on line 172 Here is my include file code that I call, when someone clicks to create a new thread: PHP Code:
$threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost'); I am assuming there is something wrong with the $vbulletin object I am passing. Cryo mentioned something about an additional database connection that was messing things up. Is this something I need to check? I do open a connection to my non-forum database before I include the above file. Any suggestions here? Thank you. |
#13
|
||||
|
||||
Where are you using it in? If it is another PHP application, what is the variable for that application's database handle?
|
#14
|
|||
|
|||
Yes, I am using it in another php file. I don't think I have a db handle variable.
I open my db connection, just with a: mysql_select_db(); do you have any suggestions for me from here? |
#15
|
||||
|
||||
So you have 2 database connections on the same page?
|
#16
|
|||
|
|||
I open a DB connection before I include the file to build the new thread.
In the include file, I require_once(global.php). Does this create another db connection? If so, is this the problem. And, do you have suggestions for this? Thanks again. |
#17
|
||||
|
||||
If you can call $vbulletin->db, you have no problem - but this is the problem, the DM doesn't detect that it is an object.
When opening your own connection, you need to assign a variable to the connection - an identifier. Then use this identifier in your own queries. See the PHP manual for more info. |
#18
|
|||
|
|||
My script looks something like this:
require_once('global.php'); then I get some user info from the $vbulletin object. then I make a connection to the db like this: $link = mysql_connect($host, $usr, $pass); mysql_select_db($database, $link); if ($_POST) { // the post vars pass info to create a thread remotedly require('new_thread.php'); // this is the file i included in my first post after the thread is created, the program goes on to make more sql db calls } then continues on to regular script. Is there something I should be doing differently with the db connections? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|