【问题标题】:how to send my value to my database如何将我的值发送到我的数据库
【发布时间】:2014-05-24 17:59:36
【问题描述】:

你好,我想在我的结构中将我的值插入到数据库中。

<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 天,所以我给了你我星期五的例子。

【问题讨论】:

    标签: php database input insert


    【解决方案1】:

    PHP 区分大小写,isSet($_POST['descprojsam']) 应为 isset($_POST['descprojsam'])

    【讨论】:

    • 现在我可以将它添加到我的数据库中了吗?
    猜你喜欢
    • 2016-05-13
    • 2016-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-27
    • 2019-12-12
    相关资源
    最近更新 更多