Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP CRUD Operations with PHP Updating and Deleting Records Updating Records

Help! I am stuck..

I'm stuck with this code I wrote. I've tried to tweak it around to get it through, but with no luck.. Could someone tell me what went wrong here. Thanks!

Also, is it possible to combine two SQL queries into one prepare statement?

index.php
<?php    
function reassign_task($old, $new) {    
  include 'connection.php';    
  $new;
  $db->prepare('INSERT INTO projects (project_id) VALUES (?)');      
  $results->bindValue(1, $new , PDO::PARAM_STR);     
  $results->execute();
  $db->prepare('DELETE ? FROM projects WHERE COLUMN project_id');
  $results->bindValue(1, $old , PDO::PARAM_STR);   
  $results->execute();   
}