The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Vbulletin database connection
Hi, until now i never connected to the vbulletin database i know how to connect to mysql, that's the general code
PHP Code:
I hope i made myself clear thanks in advance, Scanu. |
#2
|
|||
|
|||
If you're including global.php in the script (or if it's a plugin), then you can just use $vbulletin->db->query_read() (or one of the other query functions).
If you have a separate script and you don't want to include global.php, then I think I'd include config.php and use the config variables from there in mysql calls, like you posted above. You can look in includes/class_core.php, the class vB_Database code that starts around line 83, to see how vbulletin uses the config variables. Edit: if this is for a mod you're planning to release, I think it's a much better idea to find a way to use the vb code so that you don't have to worry about the database configuration. |
#3
|
||||
|
||||
mysql_query() = $vbulletin->db->query
mysql_fetch_row() = $vbulletin->db->fetch_row mysql_fetch_assoc() = $vbulletin->db->fetch_assoc mysql_fetch_object() = $vbulletin->db->fetch_object Just like this? |
#4
|
|||
|
|||
Quote:
Also, remember that if you use any strings that you're getting from the outside world in one of your queries, put it through escape_string() first. |
Благодарность от: | ||
Scanu |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|