Jump to content

jamistewart

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jamistewart's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm following the tutorial from Kevin Skoglund from the Lynda tutorials but it might be kinda dated. I've only been learning for 13 days so far so all of this is brand brand new to me. Do you suggest a better place to learn? Thank you for all your replies
  2. I fixed that and I am still getting the error
  3. I am getting this error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 I have absolutely not a clue what that means or where I went wrong, but ANY help would be appreciated. I've checked my DB username, pass and db name and they are all correct. I am getting the error when I type in $subject_set = mysql_query("SELECT * FROM pages WHERE subject_id = ${subject["id"]}", $connection); if (!$subject_set) { die("database query failed: " . mysql_error()); } this is my code: <?php require_once("includes/connection.php"); ?> <?php require_once("includes/functions.php"); ?> <?php include("includes/header.php"); ?> <div id="sidebar"> <ul> <?php $subject_set = mysql_query("SELECT * FROM subjects", $connection); if (!$subject_set) { die("database query failed: " . mysql_error()); } while ($subject = mysql_fetch_array($subject_set)) { echo "<li>{$subject["menu_name"]}</li>"; } $subject_set = mysql_query("SELECT * FROM pages WHERE subject_id = ${subject["id"]}", $connection); if (!$subject_set) { die("database query failed: " . mysql_error()); } while ($subject = mysql_fetch_array($subject_set)) { echo "<li>{$subject["menu_name"]}</li>"; } ?> </ul> </div> <div id="content"> <h1 class="sidebar">Content Area</h1> </div> </body> </html> <?php mysql_close($connection); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.