validation_errors['ntelaio']= "Numero di telaio con garanzia attiva"; return false; } ?>and cameback these error:Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /web/htdocs/www.redmoto.it/home/rivenditori/administrator/components/com_chronoforms/form_actions/custom_serverside_validation/custom_serverside_validation.php(19) : eval()'d code on line 33But at another site made with joomla 2.5 and these code belove[code]at another site made whit joomla 2.5 these code below :// Acquisisco il numero di telaio $ntelaio=$form->data['ntelaio']; $controllo = "SELECT * FROM garanzie_attivazione WHERE ntelaio = '$ntelaio'"; $risultato = mysql_query($controllo); if (mysql_num_rows($risultato) $ntelaio){ $form->validation_errors['ntelaio']= "Numero di telaio con garanzia attiva"; return false; } ?>work very well๐Ÿ˜€ Why don't work on joomla 3thanks in advance to all the people who will anwser"> Sever side validation - Forums

Forums

Sever side validation

marcoboni 22 Jul, 2014
Hi all,๐Ÿ˜€
i insert in my site on the "Events" Chronoform these code:
<?php
$DB_host = "localhost";
$DB_user = "sqlusers";
$DB_password = "mypassword";
$DB_name = "namedb";
										
	
	
$link = mysql_connect($DB_host, $DB_user, $DB_password);
if (!$link) {
	die ('Non riesco a connettermi: ' . mysql_error());
}

$db_selected = mysql_select_db($DB_name, $link);
if (!$db_selected) {
	die ("Errore nella selezione del database: " . mysql_error());
}

 // Acquisisco il numero di telaio
 $ntelaio=$form->data['ntelaio'];
 $controllo = "SELECT * FROM garanzie_attivazione WHERE ntelaio = '$ntelaio'";
 $risultato = mysql_query($controllo);

      if (mysql_num_rows($risultato) <>$ntelaio){
	  	
	$form->validation_errors['ntelaio']= "Numero di telaio con garanzia attiva";
	return false;
		 }
   
?>

and cameback these error:

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /web/htdocs/www.redmoto.it/home/rivenditori/administrator/components/com_chronoforms/form_actions/custom_serverside_validation/custom_serverside_validation.php(19) : eval()'d code on line 33


But at another site made with joomla 2.5 and these code belove
[code]
at another site made whit joomla 2.5 these code below :
// Acquisisco il numero di telaio
 $ntelaio=$form->data['ntelaio'];
 $controllo = "SELECT * FROM garanzie_attivazione WHERE ntelaio = '$ntelaio'";
 $risultato = mysql_query($controllo);

      if (mysql_num_rows($risultato) <>$ntelaio){
	  	
	$form->validation_errors['ntelaio']= "Numero di telaio con garanzia attiva";
	return false;
		 }
   
?>

work very well๐Ÿ˜€
Why don't work on joomla 3

thanks in advance to all the people who will anwser
GreyHead 23 Jul, 2014
Hi marcoboni,

There is no error, just a PHP warning message. You can either hide the messages by setting Error Reporting to System Default or None in the Site Global Configuration OR you can debug your custom code so that the Warning doesn't show any more.

Bob
This topic is locked and no more replies can be posted.