fork download
  1. <?php
  2. public function add_albums($band_id,$albums)
  3. {
  4. try
  5. {
  6. for ($i=0 ; $i<count($albums); $i++)
  7. {
  8. $album_id=$albums[$i];
  9. $string="INSERT INTO `bands_albums` (`band_id`,`album_id`) VALUES (:band_id,:album_id)";
  10. $query=$this->db->prepare($string);
  11. $query->bindValue(':band_id', $band_id, PDO::PARAM_INT);
  12. $query->bindValue(':album_id', $album_id, PDO::PARAM_INT);
  13. $query->execute();
  14. }
  15. }
  16. catch (PDOException $e)
  17. {
  18. echo 'add_albums: ' . $e->getMessage();
  19. }
  20. }
  21. ?>
Runtime error #stdin #stdout #stderr 0.01s 20592KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected 'public' (T_PUBLIC) in /home/C3IMr9/prog.php on line 2