I'm working a while now with this fantastic component, thanks for that!!
But I'm stuck with a problem which I am not able to fix.
I have a database named 'Koper-ID' which has one column 'Koper-ID'.
In my form I have a field named 'Koper-ID'.
When somebody is filling the form, the he puts into the field 'Koper-ID' should be checked within the database.
When the number is found in the database it's a success otherwise a fail. Both events have a simple message displayed.
In the 'on submit' section I made an 'Event switcher' with this code:
But no mather what I fill into the form, when I submit, I receive this:
$db = JFactory::getDbo(); $user = JFactory::getUser(); $query = $db→getQuery(true); $query= SELECT * FROM ‚hyn4b_Koper-ID‚ WHERE ‚Koper-ID’=.$user→get(„Koper-ID”).; $db→setQuery($query); $db→query(); $num_rows = $db→getNumRows(); if ($num_rows==0){ return „success”; }else{ return „fail”; }
What am I doing wrong?
Thanks in advance
But I'm stuck with a problem which I am not able to fix.
I have a database named 'Koper-ID' which has one column 'Koper-ID'.
In my form I have a field named 'Koper-ID'.
When somebody is filling the form, the he puts into the field 'Koper-ID' should be checked within the database.
When the number is found in the database it's a success otherwise a fail. Both events have a simple message displayed.
In the 'on submit' section I made an 'Event switcher' with this code:
$db = JFactory::getDbo();
$user = JFactory::getUser();
$query = $db->getQuery(true);
$query= SELECT * FROM `hyn4b_Koper-ID` WHERE 'Koper-ID'=.$user->get("Koper-ID").;
$db->setQuery($query);
$db->query();
$num_rows = $db->getNumRows();
if ($num_rows==0){return "success";}
else{return "fail";}
But no mather what I fill into the form, when I submit, I receive this:
$db = JFactory::getDbo(); $user = JFactory::getUser(); $query = $db→getQuery(true); $query= SELECT * FROM ‚hyn4b_Koper-ID‚ WHERE ‚Koper-ID’=.$user→get(„Koper-ID”).; $db→setQuery($query); $db→query(); $num_rows = $db→getNumRows(); if ($num_rows==0){ return „success”; }else{ return „fail”; }
What am I doing wrong?
Thanks in advance