Jump to content

aquapan

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aquapan's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks aeroswat again.... you are a legend. is there a hero button here somewhere? Cheers Aqua
  2. You were right on that too... a little help is needed on the mail. I thought $subject would throw detail into the subject but for whatever reason it throws it into the body of the email. The from I had originally seemed to be ignored by the mail function and it just sent it direct from the server. Is there a way to define from as well? I will also do some code adjustments as well as I am looking at this alerting when someone reaches 500 posts and then again when they reach 1000 posts. The idea being that this is triggered daily as a report via a cron job. Cheers Aqua
  3. Wow Aeroswat you are fast... thanks! I will give this a try Cheers Aqua
  4. Hi, I got stuck recently attempting to read an sql database using php as I kept on getting the error: Warning: implode() [function.implode]: Invalid arguments passed in /home/***/public_html/***/includes/query_posts.php on line 28 The idea was that I would create this php page that would read an vbulletin sql database and then pop off an email when a user is over certain post amounts of 500 and 1000. The idea being that the poster is rewarded for their efforts etc. Here below is the code I am using with identifying site information trimmed of course using *** symbols - this version is for the 500 post limit being met or exceeded. <?php //Get variables from config.php to connect to mysql server require 'config.php'; // connect to the mysql database server. mysql_connect ('localhost', '***', '***'); //select the database mysql_select_db('***_forums1') or die('Cannot select database'); //select statement for users $sql = "SELECT username FROM user WHERE posts >='500'"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); $username = $row["username"]; //take the emails and add a comma to email and create an string $list = implode(',' , $username); echo $list; $to = "***@***.com"; $subject = "These users have reached 500 posts "&$list; //send the emails //mail($to, $from, $subject); ?></p> Now I can't see why this error would happen as I don't fully understand implode and its requirements. Any help appreciated. Thanks Aqua
  5. Hello Everyone! I found your site after losing my mind on a simple php sql idea and thought I would join your group and have since discovered you have such an amazing resource here that I might actually gain a greater understanding of what I am doing. Cheers Aqua
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.