Escape ' from SELECT query? - Joomla! Forum - community, help and support
hello,
i having trouble select queries, seems ones apostrophes in them.
code:
$query-> where($db->quotename('dept_name') . '='. $db->quote('clerk's office'));[/code]
database:
(see attached image)
when click on link on test site (or enter link), blank page. thing can think of need escape ' not sure how. not noticing other syntax errors. maybe need set of eyes?
thanks!
i having trouble select queries, seems ones apostrophes in them.
code:
$query-> where($db->quotename('dept_name') . '='. $db->quote('clerk's office'));[/code]
database:
(see attached image)
when click on link on test site (or enter link), blank page. thing can think of need escape ' not sure how. not noticing other syntax errors. maybe need set of eyes?
thanks!
try
$query->where($db->qn('dept_name') . '='. $db->q('clerk\'s office'));
$query->where($db->qn('dept_name') . '='. $db->q('clerk\'s office'));
Comments
Post a Comment