Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 08-10-2005, 05:39 AM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Custom Pages Pulling From Database

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>
This obviously doesn't work... so if you have a way to help me, please let me know. This would be a good hack. ^^
Reply With Quote
  #2  
Old 08-10-2005, 12:48 PM
twoseven twoseven is offline
 
Join Date: Jan 2004
Location: in floris' pants
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 08-10-2005, 09:06 PM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 08-10-2005, 09:28 PM
twoseven twoseven is offline
 
Join Date: Jan 2004
Location: in floris' pants
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 08-11-2005, 03:41 AM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:09 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03812 seconds
  • Memory Usage 2,188KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete