Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Hello, I just bought your plugin and I am trying to add the validation against DB feature as I requested in past (in your CodeCanyon comment page as “newpolaris”).
My issue is how to do a mysql query versus a custom table (called ‘tab) that I created inside WP database.
I tried adding to “ajax.php” something like this:
case ‘my_validation’:
$count = mysql_fetch_array(mysql_query(“SELECT COUNT(*) FROM tab
WHERE value
='” . $input_value) . “‘ LIMIT 1”);
if ($count[‘0’] == 0) {
$output[‘error’] = __(‘value not accepted’,’userpro’);
}
break;
and in addition, I created a custom field in “Fields” inside admin area and I added the value “my_validation” inside “Ajax Check Callback (advanced)” field.
But it doesn’t work….
How is it possible to validate a custom field (text) against a value in DB, please?
Thanks
Could you please help me with a small information first?
Is it going inside the case my_validation?
If Yes then php code seems to cause the trouble for the failure of the execution.
You must be logged in to reply to this topic.