SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Threaded View

  1. #1
    SitePoint Member
    Join Date
    May 2013
    0 Post(s)
    0 Thread(s)

    php mysql novice to ninja 5th edition

    php mysql novice to ninja 5th edition

    chapter 7

    After following the steps I keep getting the error:
    Warning: Invalid argument supplied for foreach() in /Applications/XAMPP/xamppfiles/htdocs/ijdb/admin/authors/authors.html.php on line 13

    Does anyone know where I went wrong or where the book went wrong, here's the code:

    PHP Code:
    <?php include_once $_SERVER['DOCUMENT_ROOT'] .
    <!DOCTYPE html>
    <html lang="en">
        <meta charset="utf-8">
        <title>Manage Authors</title>
        <h1>Manage Authors</h1>
        <p><a href="?add">Add new author</a></p>
          <?php foreach ($authors as $author): ?>
              <form action="" method="post">
                  <?php htmlout($author['name']); ?>
                  <input type="hidden" name="id" value="<?php
    echo $author['id']; ?>">
                  <input type="submit" name="action" value="Edit">
                  <input type="submit" name="action" value="Delete">
          <?php endforeach; ?>
        <p><a href="..">Return to JMS home</a></p>
    Last edited by SpacePhoenix; May 16, 2013 at 22:49. Reason: placed php tags around php code


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts