The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I'm not really sure how to describe what I am looking for. I learned that what I had tried to do was not possible. Basically, I tried to use php within a vbphrase and within a template. Turns out I can't do that. I'm looking for a way that I can easily specify what I would like to pull from the database. Specify a table, the fields, and all that fun stuff. Think someone can think something up?
Here's an example of what I tried to do... Code:
<table align="center" border="1" cellspacing="1" cellpadding="1">
<?PHP
$dbhost = 'localhost';
$dbuser = '';
$dbuserpassword = '';
$dbname = '';
$tablename = '';
$conn = mysql_connect("$dbhost", "$dbuser", "$dbuserpassword")
or die(mysql_error());
mysql_select_db("$dbname",$conn) or die(mysql_error());
$result = mysql_query("SELECT * FROM $tablename");
while($query_data = mysql_fetch_row($result)) {
echo "<tr><td width=125>", $query_data[1],"</td>";
echo "<td>", $query_data[4],"</td></tr>";
echo "<tr><td colspan=2>", $query_data[2],"</td></tr>";
echo "<tr><td colspan=2>", $query_data[3],"</td></tr>";
}
?>
</table>
|
|
#2
|
|||
|
|||
|
you would have to make a php file for it and including[code]global.php[/php] would get you access to all vb's functions unless you wanted it to pull from a secondary database
https://vborg.vbsupport.ru/showthread.php?t=62164 is the tutorial for making your own page |
|
#3
|
||||
|
||||
|
I'm not really sure that's what I'm looking for. I also do not believe that works with 3.5. I made a new table in the database and I would like to be able to list what's in it. Looking at his hack, it doesn't seem as though I can do that. If I am able to do it, I am unsure of how to go about doing it.
|
|
#4
|
|||
|
|||
|
that is just a tutorial and yes it is valid for 3.5 to acess a custom table you need to do your own querys select/writes etc.
|
|
#5
|
||||
|
||||
|
Well, let's pretend that I didn't know how to do my own queries and whatnot. How would I specify what tables and fields I wanted to use?
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|