Hi,
in event onsubmit i have the custom code below
when i push the button submit, this code is executed and data saved on database but when reload webpage i receive the error
Can someone help me ?
in event onsubmit i have the custom code below
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db('ecopm');
$sql = "DELETE FROM sede_installazione_video WHERE ID_SEDE = " . $form->data['ID_SEDE'];
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
//echo "Records cancellati-> " . mysql_affected_rows();
foreach ($form->data['ID_VIDEO_ASSOCIATI'] as $d) {
$sql = "INSERT INTO sede_installazione_video( ID_SEDE, ID_VIDEO) VALUES ( " . $form->data['ID_SEDE'] . ", " . $d . ")";
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
}
//echo "Records inseriti";
mysql_close($conn);
header("location: /index.php?option=com_chronoforms5&chronoform=Gestione_Video");
?>
when i push the button submit, this code is executed and data saved on database but when reload webpage i receive the error
Can someone help me ?