Hi, I'm using 'submit article'. That all works, but now I want to check if that article already exists. So I want to use the field 'onderwerp' to check is it existst in 'jos_content'. I tried the following, but I just don't understand what I'm doing wrong.
I'm using the custom server side validation with this code:
I'm using the custom server side validation with this code:
<?php
$cf = JRequest::getString('title', '', 'onderwerp');
$db =& JFactory::getDBO();
$sql = "
SELECT COUNT(*)
FROM `jos_content`
WHERE `title` = ".$db->Quote($cf);
";
$db->setQuery($sql);
$result = $db->loadResult();
if ( $result ) {
return "This user is already in the database ";
}
?>