fork download
  1. <?php
  2. function addItemToCatalog($title, $author, $pubyear, $price)
  3. {
  4. $sql = 'INSERT INTO catalog (title, author, pubyear, price) VALUES (?, ?, ?, ?)';
  5. if (!$stmt = mysqli_prepare($link, $sql))
  6. return false;
  7. mysqli_stmt_bind_param($stmt, "ssii", $title, $author, $pubyear, $price);
  8. return true;
  9. }
Runtime error #stdin #stdout #stderr 0.02s 52472KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Notice:  Undefined index: title in /home/JRogjg/prog.php on line 3
PHP Notice:  Undefined index: author in /home/JRogjg/prog.php on line 4
PHP Notice:  Undefined index: price in /home/JRogjg/prog.php on line 5
PHP Notice:  Undefined index: pubdate in /home/JRogjg/prog.php on line 6
PHP Fatal error:  Call to undefined function mysqli_query() in /home/JRogjg/prog.php on line 8