I have a table with data and a column named 'week'. Everytime an user post something to the database, this is added to the column 'week':
$week = Date('W');
So everything inserted in this week have the number '13' in the week-column. Now I would like a query that select everything from this week and post on my site, so I wrote a variable like the one above and wrote:
$sql = 'SELECT * FROM my_table WHERE week = $week';
But it echos an error: Unknown column '$week' in 'where clause'.
It works fine, if I write SELECT * FROM my_table WHERE week = 13;
but I would like it to automatically select the current week number.