使用带有php的mysql中的textarea保存描述

时间:2016-06-01 12:41:52

标签: php mysql

enter image description here任何人都可以帮助我如何在MySQL的文本区域中保存文本并将其查看到另一页。[![在此输入图像描述] [2]] [2]

这是我的代码:

extern __attribute__((weak)) void* _XCTSetEventConfirmationTimeout(NSTimeInterval);
// Change the default 30 seconds timeout.
long MY_NEW_EC_TIMEOUT = 120;
NSLog(@"Trying to call _XCTSetEventConfirmationTimeout(%ld)", MY_NEW_EC_TIMEOUT);
if (&_XCTSetEventConfirmationTimeout) {
    NSLog(@"_XCTSetEventConfirmationTimeout address found");
    _XCTSetEventConfirmationTimeout(MY_NEW_EC_TIMEOUT);
    NSLog(@"_XCTSetEventConfirmationTimeout successfully called");
} else {
    NSLog(@"_XCTSetEventConfirmationTimeout address not found");
}

enter image description here

3 个答案:

答案 0 :(得分:0)

您需要在mysqli_error()函数中添加连接作为参数See here

答案 1 :(得分:-1)

使用mysql_insert_id()获取最后一个输入的id,然后像往常一样用它进行查询。见http://php.net/manual/en/function.mysql-insert-id.php

答案 2 :(得分:-1)

尝试以下方法:

if(isset($_POST['add'])){

    if(empty($_POST['position'])){ 

        echo '<script> alert("position is required!"); </script>';

    }else{

        $position = test_input($_POST["position"]);
        $description = $_POST["description"];

        if(empty($_POST["description"])){ 
            echo '<script> alert("description is empty!"); </script>';
            $description = "The $_POST value was empty so nothing was stored here ;-)";
        }

        $sql= "insert into tbl_jobdescription(position,description) values ('$position','$description')";
        $result = mysqli_query($conn,$sql)or die(mysqli_error($conn));

        if($result){

            echo '<script> alert("Successfully add admin account."); </script>';
            $position = $description = "";

        }
    }
}

您之前的代码中已经建立了连接? Otherwhise $conn不是要使用的valide mysql资源。