Bruce Gust
asked on
What is wrong with this PDO Delete Query?
I'm stripping this thing down to bear bones and I'm still coming up with an error. What am I doing wrong?
Here's the code:
require_once('../bootstrap .php');
$con=DatabaseFactory::Crea teOneCommu nityConnec tion();
//$participantid=$_POST['p articipant id'];
//$readingtypeid = $_POST['readingtypeid'];
$participantid=1;
$readingtypeid = 1;
//1. DELETE ALL READINGS FROM TBLPARTICIPANTREADING
$DeleteReadings=$con->prep are("delet e from tblparticipantreading where participantid = :participantid");
$DeleteReadings=bindParam( ':particip antid', $participantid, PDO::PARAM_INT); //as soon as I add this line, I get an error that says the page can't be displayed. Why?
//$DeleteReadings->execute ();
?>
I've got a good database connection. I can run $DeleteReadings=$con->prep are("delet e from tblparticipantreading where participantid = :participantid"); and there are no errors, but as soon as I add $DeleteReadings=bindParam( ':particip antid', $participantid, PDO::PARAM_INT); , I get a 500 error.
What's wrong with what I'm doing? Where am I blowing it?
Here's the code:
require_once('../bootstrap
$con=DatabaseFactory::Crea
//$participantid=$_POST['p
//$readingtypeid = $_POST['readingtypeid'];
$participantid=1;
$readingtypeid = 1;
//1. DELETE ALL READINGS FROM TBLPARTICIPANTREADING
$DeleteReadings=$con->prep
$DeleteReadings=bindParam(
//$DeleteReadings->execute
?>
I've got a good database connection. I can run $DeleteReadings=$con->prep
What's wrong with what I'm doing? Where am I blowing it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!