JcAndres
Member
hi ...
i have 2 questions
1-----
i'm trying to make a validation, if a report number exist or not in database. for this i use the option for execute a script php when form its submited (("as soon as form submited (simple eval)"))
firts i check data sent by form with
echo "<pre>";print_r($aData);echo "</pre>";
exit;
next i write this code in configuration of form in the option for execute php script.
my principal problem it's that i cant count rows give it for the query.
2---
when report number exist can i show a msg similar to msg of validation?
actually i use fabrik 1.0.6 svn 1028 with joomla 1.0.15.
great from the end of the earth...
i have 2 questions
1-----
i'm trying to make a validation, if a report number exist or not in database. for this i use the option for execute a script php when form its submited (("as soon as form submited (simple eval)"))
firts i check data sent by form with
echo "<pre>";print_r($aData);echo "</pre>";
exit;
Code:
Array
(
[inc_reporte___reporteid] => 35
[inc_reporte___reportecliente] => 1
[inc_reporte___reportenumero] => 12345
[inc_reporte___reportemodelo] => 2
[inc_reporte___reporteserie] => kjh9876987
[inc_reporte___reportefalla] => 4
[inc_reporte___reporteciudad] => 56
[inc_reporte___reportesla] => 4
[inc_reporte___reportefapertura] => 13-09-2008 00:00
[inc_reporte___reportefgendada] =>
[inc_reporte___reportefatencionos] =>
[inc_reporte___reportefcierrefinal] =>
[inc_reporte___reportecomentario] => Prueba8
[inc_reporte___reporteuser] => admin
[tableid] => 7
[fabrik] => 7
[task] => processForm
[rowid] => 35
[Itemid] => 4
[option] => com_fabrik
[form_id] => 7
[fabrik_frommodule] =>
[fabrik__cursor] => 18
[fabrik__total] => 19
[returntoform] => 0
[fabrik_referrer] => http://localhost/santander/index.php?option=com_fabrik&task=viewTable&tableid=7&Itemid=4
[layout] => default
[jdda468b6c86c17a56539de5c9bcf761d] => 1
[fabrik_repeat_group_7_counter] => 1
[Submit] => Guardar
)
next i write this code in configuration of form in the option for execute php script.
PHP:
global $database;
$reporte = mosGetParam($_POST, 'inc_reporte___reportenumero');
$sql = "select * from inc_reporte where reportenumero = $reporte";
$database->setQuery($sql);
$database->query();
if (mysql_num_rows($sql) > 0){
echo ('reporte ya ingresado');
exit;
}
else {
echo ('Reporte no ingresado');
}
my principal problem it's that i cant count rows give it for the query.
2---
when report number exist can i show a msg similar to msg of validation?
actually i use fabrik 1.0.6 svn 1028 with joomla 1.0.15.
great from the end of the earth...