Hi. I am new to PHP and sql query.
Is it possible to use placeholders in snippets? Or is there any way I could get the "longtitle" of the document (where I call the snippet) into the place where I define "WHERE" in a query?
I’m making personalized document for each web user and I’d call all the data from the db where the exact web user is mentioned. Possibility to use "longtitles" would save time, otherwise I was planned to make own snippet for every user.
From this:
$sql = $modx->db->query( ’SELECT * FROM `tblprojects` where name="Tim"’);
Into something like this:
$sql = $modx->db->query( ’SELECT * FROM `tblprojects` where name="[*longtitle*]"’);
Thanks.