Announcement

Collapse
No announcement yet.

Trying to add PHP to my forums

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trying to add PHP to my forums

    I am trying to add this simple PHP code to scrape the latest currency to my forums. What is the best and easiest way? thanks,

    <?php
    $today = date('Y-m-d');
    $con = mysql_connect('localhost', 'user', 'passwd'); # please put appropriate values here
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("currency", $con); # please replace 'mydb' with your database name.
    $query = "SELECT cur_rate FROM currency WHERE cur_date = '$today' AND cur_code = 'PHP'";
    $result = mysql_query($query)
    or die(mysql_error());
    $row = mysql_fetch_array( $result );
    $php = $row['cur_rate'];

    echo $php;


    ?>

    i tried to write a plugin and used global_start as the hook and it worked one time and then went away and never came back. PLEASE HELP!

    also, while i am at it, how would one format the number that it outputs so it is only 2 decimal places?

    thanks in advance

  • #2
    For modifications, plugins, etc, vBulletin.org is the best place to find help.

    Comment


    • #3
      Originally posted by Zachery View Post
      For modifications, plugins, etc, vBulletin.org is the best place to find help.
      i just want to add php to my vbulletin somehow and it doesnt seem to be an easy task. there has got to be a way.

      Comment


      • #4
        There are ways, but we cannot help you with them, we cannot provide support for third party coding, plugins, etc.

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X