Elaine Adams
Elaine Adams

Reputation: 179

PDO - Something is not quite right with my statement 'Undefined class constant 'PARAM_STRING''

I am new to PDO and have managed to get some statements working, but now I am trying to work with a 'string' and am getting an error message. Clearly I'm doing something wrong here.

I get this error message:

Undefined class constant 'PARAM_STRING'

here is my code:

require_once('../scripts/includePDO.php');

$who = 65; //temp value to be deleted
$status = $_POST['status'];

$sql = "INSERT INTO tbl_status(from_user, status, deleted) VALUES (:who, :status, '0')";

$q   =  $conn->prepare($sql);
        $q->bindValue(':who',$who,PDO::PARAM_INT);
        $q->bindValue(':status',$status,PDO::PARAM_STRING);
        $q->execute();

header("Location: ../home/");

Upvotes: 1

Views: 1917

Answers (1)

The Blue Dog
The Blue Dog

Reputation: 2475

PDO::PARAM_STRING is incorrect, you need to use PDO::PARAM_STR instead.

Upvotes: 2

Related Questions