你好我想在我的结构中将我的值插入数据库。
<tr>
<td>
<b>Vendredi</b> </br><?php echo $date6 ?>
</td>
<td>
<input size="10" type="text" id="projvendredi" name="projvendredi"onkeypress="return handleEnter6(event, this, 'task');"/>
</td>
<td>
<input type="text" name="clientvendredi" class = "client" size="12" id ="clientvendredi" disabled />
</td>
<td>
<input type="text" name="projdesvendredi" size="30" class "desc" id ="projdesvendredi"disabled />
</td>
<td>
<span id="calculTemps5">
<input id="input6" class= "temps" type="number" name="tempsv" size="2" min="0" max="24" value="0" /></br>
</span>
</td>
</tr>
和我的按钮
<input type="text" id="result" readonly="readonly" name="total" />
<input type="submit" value="Terminé" id="end" />
<input type="hidden" name="data" value="<?php echo $date; ?>" />
</p>
</form>
这是我的insert.php
$date = $_POST['data'] ;
if (isSet($_POST['descprojsam']))
{
$descprojsam = $_POST['descprojsam'] ;
echo($descprojsam);
}
echo($date);
// Connect to the DB
$link = mysqli_connect("localhost","root","","cruel") or die("Error " . mysqli_error($link));
// adding new recherche
if(!empty($_POST['descprojsam']))
{
$sql = " INSERT INTO `projetstaches`(`prtId`, `prtTimeSheetId`, `prtProjetNum`, `prtDate`, `prtTaskId`, `prtTime`, `prtLocation`, `prtDescription`)
([value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7],'$descprojsam')";
$link->query($sql);
}
?>
我没有完成插入,因为我不知道该怎么做。我有7天所以我给了你星期五的例子。
答案 0 :(得分:0)
PHP区分大小写,isSet($_POST['descprojsam'])
应为isset($_POST['descprojsam'])