The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Connecting to MySQL database?
Heya guys ... I think I nee a bit of help here. I want to start a couple of hacks, but can't figure out the very basics of how vB connects to my database?
From what I've learned on my own, the way to connect is with a mysql_connect() or mysql_pconnect() function (which is better?). Since I can't find either anywhere, I'm assuming there's another method I'm not aware of. That being said, I would think that whatever the command, it would use the $dbusername and $dbpassword variables set in the config.php file? Also that the $dbname variable would be used to identify the name of the database. I couldn't find any of these variables anywhere? Is there really no need for this? Is there already some 'magical' (for lack of a better word .. lol) connection, and all I really need to do is use some 'require_once()' functions to include some vB page that has the connection info set into some usable variables already? Or do I need to specify a connection command and a mysql_select_db($dbname); command? Followed by a: $query_results = mysql_query("SELECT blablabla FROM table_xyz;"); Then use whatever HTML and various PHP looping/if/then statements needed, with the following to show what I wanted to show: $rowdata = mysql_fetch_array($query_results); echo htmlspecialchars(stripslashes($rowdata("column_nam e")); Seems I've got the basics, but I'm not sure if it's all been set-up already in some way? Anyhow ... any help getting me on track would be greatly appreciated !!! ... Hopefully I'll soon be able to add some quality hacks to this community !!! Not sure if this is stuff already incorporated in vB that I can use, or just basic MySQL/PHP stuff ... feel free to move it to the PHP/MySQL forum if you feel it's more in that domain ... although I really hope there's something already incorporated into vB to access the database !!! lol Thanks to all who take the time to get through this .. as you can see ... I'm slowly making progress !!! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|