Jump to content

I-AM-OBODO

Members
  • Content Count

    394
  • Joined

  • Last visited

Everything posted by I-AM-OBODO

  1. Hello and thanks for the response. I have tried different ways from what i understand you said and all to no avail. If you can, use my code to clarify me pls. Thanks
  2. And after following your guide, I was able to get the result on the debug mode but the message and the table headings did not display. I even tried to use it to test it live but did not get any mail. $currentcust = ''; $emailcontent=" <div class='messages'> <h3><img src='cid:my_logo'></h3> <br> <h4><div style='font-size:15px;'>Email Notification </h4> <br> <p>Dear: Client</p> <p> The following bills are due for payment: </p> <table width='80%' border='0' cellspacing='0' cellpadding='0'> <tr style='fon
  3. I noticed that from the beginning and corrected the typo. Don't think its the problem
  4. Hello and thanks for the response. when i added the following: echo "Debug line: Content of records variable<pre> " . print_r($records, 1) . "</pre>"; It echoed the result in array. Maybe I am not making my self clear enough but what I am saying is that it echoed the message with the table headings but no details. I have tried so many debugging that i could muster but all to no avail. It echoes: $message = " <div class='messages'> <h3><img src='cid:my_logo'></h3><br> <div style='font-size:16px; font-weight
  5. Thanks. And sorry for not being elaborate in my reply. I meant that a mail was sent but it was empty. The details of the bill was not sent along. Even after adding your debugging code, it brought out same empty message. I did a little alteration though cos the code gave an error and i noticed it was mere omission here: ##----------------------## ## Create and run query ## ##----------------------## $bill_status = "OVERDUE"; $query = "SELECT username, trans_ref, due_date, service_provider, service_type, amount_paid, bill_status, recurring, DATEDIFF(NOW()
  6. Oops! sorry all. Mine did not work either, it sends to all users
  7. in between, will try to work something based on your directions and see what i come up with. I tried my working script to send mails manually it worked but still wont work on cron. I dont want to open another thread cos i might be violating the rules of the forum which i wouldnt want to do. this is my command line for the cron: Thanks 0 0 * * * /usr/local/bin/php /home/user/public_html/mydirectory/cronjobs/cron-reminder.php
  8. Thanks all. I have been able to see the reason why my script did not work as intended but i have fixed it and its working perfectly now. I removed the send message from the loop and it did the magic. I really dont know if theres anything wrong with my style but it did the magic for me. Would like a pointer to a good direction if need be on my script. Like psych noted out concerning my unclosed html tags Thanks all
  9. Thanks but didnt work. Yours sends empty message without the bills details. I like the way you structure your code and learnt a thing or two form it. Thanks a great deal
  10. the problem was not solved and it was not the same. the initial thread was diff but i just added it to find two solutions without opening two threads. can you help with it though. would be glad if u can. thanks
  11. Hi all Please, i have a script that send email to customers. The problem with the script is that it sends multiple mails but all i want is for it to send one mail containing details of multiple rows. i.e all the bill details should be in a table. below is my script Thanks $bill_status = "OVERDUE"; $st = $pdo->prepare("SELECT *, DATEDIFF(NOW(), due_date) AS days_diff FROM bills LEFT JOIN login_details ON bills.user_id = login_details.user_id WHERE bills.bill_status = '$bill_status'"); $st->execute(); $row_sent = $st->rowCount(); //$message = htmlspecialchars($mess); $mail
  12. The dear username shouldnt be of any worries to you and that isnt my problem either. my problem is getting the script to send just one mail containing all the bills. just so you know: it is dear username which translates to: dear myemailaddress.com
  13. I really do not understand why you dont understand me. I said the script is to send just a mail with the bills due in a table. All the bills should be tabulated. I tried the script manually but its sending multiple mails i.e if a customer has 4 bills, it sends 4 different mail but that is not what i want, all i want is a single mail to be sent to the customer detailing the bill details in a table. If you can help, please do help and lets get it over with. Below is my whole script: $bill_status = "OVERDUE"; $st = $pdo->prepare("SELECT *, DATEDIFF(NOW(), due_date) AS days_diff FROM bill
  14. 1. yes. the script is suppose to send all the bills a user has 2. this is where i have my error reporting 3. this is all the code there is or is it incomplete? 4. i said the username is the email and not name error_reporting(0); $database='dbname'; $user='username'; $password='password.'; $dsn="mysql:host=localhost;dbname=$database"; try { $pdo = new PDO($dsn,$user,$password); } catch(PDOException $e) { die ('Failed to connect'); } thanks
  15. This is the Exact scrpt $stmt=$pdo->prepare("SELECT *, DATEDIFF(NOW(), due_date) AS days_diff FROM bills LEFT JOIN login_details ON bills.user_id = login_details.user_id WHERE xbp_bills.bill_status = 'OVERDUE'"); $stmt->execute(); //$message = htmlspecialchars($mess); $mail = new PHPMailer; //$mail->SMTPDebug = 3; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'localhost'; // Specify main and backup SMTP servers $mail->SMTPAuth = true;
  16. i have ran the script and it worked fine but wont run as a cron.
  17. This is not the final script. My final script is: $stmt = $pdo->query("SELECT *, DATEDIFF(due_date, NOW()) AS days_diff FROM xbp_bills WHERE bill_status = '$bill_status' AND CURDATE() BETWEEN due_date - INTERVAL reminder DAY AND due_date "); $stmt->execute(); $mail = new PHPMailer; //$mail->SMTPDebug = 3; $mail->isSMTP(); $mail->Host = 'localhost'; $mail->SMTPAuth = true; $mail->Username = 'username@user.com'; $mail->Password = 'password.'; $mail->SMTPSecure = 'ssl'; $mail->Port = 465; $mail->From = 'no_reply@noreply.com'; $mail->FromName = 'Coy
  18. hello this is what i ended up with. The problem now is that the cron wont send? $stmt = $pdo->query("SELECT *, DATEDIFF(due_date, NOW()) AS days_diff FROM xbp_bills WHERE bill_status = '$bill_status' AND CURDATE() BETWEEN due_date - INTERVAL reminder DAY AND due_date "); $stmt->execute(); while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $due_date = $row['due_date']; $service_provider = ucwords($row['service_provider']); $service_type = ucwords($row['service_type']); $bill_status = $row['bill_status']; }
  19. ... INTERVAL 10 DAY AND eventdate? Is it complete?
  20. Hi, I have an application where during registration a user will choose when they want to be reminded of an event. For instance the event lets say will start on 2017-02-02 and i scheduled it on 2016-12-30 and i want to be reminded everyday from 10days to the event date(2017-02-02). How do i go about it? I need idea as to know how to go about it. I dont know if cron will be good. Thanks
  21. I think i agree with you. I have changed the table to a singe table with an identifier. I created two tables cos of an issue but i have been able to sail pass that now. thanks
  22. Hi guys, How can i process the value of a search result. this is what i've tried so far: //searche result page if(isset($_POST['submit'])){ $_SESSION['from'] = $_POST['from']; $_SESSION['to'] = $_POST['to']; $sql = ("SELECT * FROM $tbl_name WHERE date_order BETWEEN '$_SESSION[from]' AND '$_SESSION[to]'"); //$stmt = $pdo->prepare("SELECT * FROM ca_processed"); $stmt=$pdo->query($sql); $stmt->execute(); $num_rows = $stmt->rowCount(); #print "<p>$num_rows Record(s) Found.</p>"; if($stmt->rowCount() <
  23. Hello guys, I'm try to sum rows in a UNION but having a hard time about it $stmt = $pdo->prepare("SELECT due_date, SUM(amount_paid) FROM ( SELECT due_date, amount_paid FROM table1 union all SELECT due_date, amount_paid FROM table2 UNION ALL )x GROUP BY MONTH"); $stmt->execute(); while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { echo $row['x']; thanks
×
×
  • 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.