Any idea why the following code displays this error? I am quite new to php and I'm struggling to see the error.
$stmt = $db->query('SELECT ti.playerid, ti.buydate, pl.playerid, pl.firstname, pl.lastname, pl.photo FROM transfersin as ti, players as pl WHERE ti.playerid = pl.playerid AND DATE_FORMAT(`ti.buydate`,\'%d.%m\') = DATE_FORMAT(NOW(),\'%d.%m\') ORDER BY ti.buydate ASC '); [/CODE]
[b]Fatal error[/b][color=#000000]: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ti.buydate' in 'where clause'' in /home/*/public_html/stats/onthisday.php:182 Stack trace: #0[/color]
Basically what I'm trying to do is show the results that happened on todays date, over the past 100 years. This actually worked until I moved some info into a new 'transfersin' column, then tried to alter the query but can't get it working.
Question
marklcfc
Any idea why the following code displays this error? I am quite new to php and I'm struggling to see the error.
Basically what I'm trying to do is show the results that happened on todays date, over the past 100 years. This actually worked until I moved some info into a new 'transfersin' column, then tried to alter the query but can't get it working.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts