|
-
Dec 3rd, 2008, 02:22 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Date problem in PHP
I would like to send an email out on a specific date (I will use cronjobs for this) and I'm testing this.
Im trying to set the date and therefore send emails for records which match this date.
$d="2008-12-04";
However, when I echo that out it only returns '2008'. I can't think why, what is going on here??
-
Dec 3rd, 2008, 05:33 PM
#2
Re: Date problem in PHP
That shouldn't echo '2008'.
Can you show the rest of your code?
-
Dec 4th, 2008, 03:00 AM
#3
Thread Starter
Hyperactive Member
Re: Date problem in PHP
Here's everything:
$d="2008-12-04";
Code:
/* GET ALL REMINDERS FOR THIS DATE */
$query="SELECT reminderid, callid FROM reminder WHERE duedate=? ORDER BY reminderid";
$stmt = $mysqli->prepare($query);
$stmt->bind_param('i', $d);
$stmt->execute();
$stmt->bind_result($reminderid, $callid);
$stmt->store_result();
if ($stmt->num_rows>0) {
while ($stmt->fetch()) {
// DO STUFF
}
} else {
echo "nothing happened ";
echo $d;
}
The only output I see is:
-
Dec 5th, 2008, 02:18 PM
#4
Thread Starter
Hyperactive Member
Re: Date problem in PHP
Fixed::
Problem was here
since $d should be a string not integer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|