Ciao.
Ho questo script che nel vecchio spazio web, funziona, ma spostandolo su un nuovo spazio che ha
Versione MySQL: 5.6... visualizza questo errore: Incorrect integer value: '' for column 'id' at row 1
lo script è questo:
Ho questo script che nel vecchio spazio web, funziona, ma spostandolo su un nuovo spazio che ha
Versione MySQL: 5.6... visualizza questo errore: Incorrect integer value: '' for column 'id' at row 1
lo script è questo:
PHP:
<?php
include 'datidb.php';
include 'conf.php';
session_start();
if ($_SESSION['username']==$usern);
else{
header('Location: login.htm');
}{ ?>
<head>
<title>INSERIMENTO PROMEMORIA</title>
<style type="text/css">
<!--
a:link {text-decoration: none;}
-->
</style>
</head>
<body style="text-align: center;" text='black' alink="black" lang="IT" link="black" vlink="black" MARGINHEIGHT="0" bgcolor='white'>
<table align='center' border='0' width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td align='left' width='33%'>
<b><a href='elenco.php'><input style='color:black;background-color:WHITE;font-size:25' type="submit" value='<-- ELENCO'></a></b>
</td>
<td align='center' width='33%'>
<font color='black' size='8'><a href='elenco.php'><?php echo $time=date('Y-m-d');?></a></font></td>
<td align='right' width='33%'></td>
</tr>
</table><br>
<?php
$data_oggi = date('Y-m-d');
$ora_oggi = date('H:i');
$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());
}
$reg = $_GET['reg'];
if ( $reg == 1 )
{
$id = $_POST['id'];
$valore = $_POST['valore'];
$data = $_POST['data'];
$ora = $_POST['ora'];
mysql_query("INSERT INTO promemoria
(id,valore,data,ora)
VALUES
('$id','$valore','$data','$ora')")
OR DIE(mysql_error());
$result = mysql_query ("SELECT * FROM PROMEMORIA");
$num=mysql_numrows($result);
while($row = mysql_fetch_array( $result ))
{
$id=$row['id'];
}
echo "<font size='8' color='red'>-- PROMEMORIA INSERITO! --</font><br><br>";
echo "<meta http-equiv='refresh' content='1;url=elenco.php' />";
}
?>
<form action='inserimento.php?reg=1' method='POST' onSubmit="return formCheck(this)">
<table align='center' bgcolor='' border='0' width='100%' cellpadding='1' cellspacing='1'>
<td align='center'>
<textarea style='color:black;background-color:white;font-size:40;' name="valore" rows="4" cols="40">
</textarea><br>
<input style='color:black;background-color:white;font-size:50;' type='date' name='data' size='10' value='<?php echo $data_oggi ;?>'>
<input style='color:black;background-color:white;font-size:50;' type='time' name='ora' size='10' value='<?php echo $ora_oggi ;?>'><br><br>
<input style='color:black;background-color:yellow;font-size:25;' name="Procedi" type="submit" value="MEMORIZZA"><br>
</td>
</table><br><br>
</form>
<br><br><br><br>
</body>
<?php
}
?>
Ultima modifica di un moderatore: