Hi,
I’m currently writing a snippet and the code requires getting the id of a TV named "match_id".
From phpMyAdmin I could check that this TV exists in table "myprefix_site_tmplvars".
The "match_id" string is stored in the "name" column.
However I get the error below. Does anyone have an idea about what I’m doing wrong ?
$table_prefix='myprefix';
$table = $table_prefix.'_site_tmplvars';
$req = "SELECT id FROM $table WHERE name=match_id";
$res = $modx->db->query($req);
« MODx Parse Error »MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - Unknown column ’match_id’ in ’where clause’ »
SQL: SELECT id FROM myprefix_site_tmplvars WHERE name=match_id
N.B. I tried replacing "SELECT id" by "SELECT name", to put `` quotes around match_id, to replace = by ==, a.s.o., but nothing helped.

I observed that "name" is of type varchar(50). Should I take this into account and trim the field value ?
Many thanks for help.