In simple terms can someone explain what I am doing wrong here - I am simply trying to insert into a db with with prepare and bindParam, this is inserting 0 and Null into al
$sql = $db->prepare("INSERT INTO db_fruit (`id`, `type`, `colour`) VALUES (:id, :name, :colour)"); $sql->bindParam(':id', $newId, PDO::PARAM_INT); $sql->bindParam(':type', $type, PDO::PARAM_INT); $sql->bindParam(':colour', $colour, PDO::PARAM_STR); $sql->execute();