Jump to content

dhpr111

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dhpr111's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanx for your reply.but it isn't working frnd.But one improvement is there.Your code doesn't give an error message.The problem is,it echo back the main menu items only.It doesn't echo back pages.
  2. yep.It has the primary key.actually this is what I want to do.I want to create a navigation menu.and subject means main items.so I want to relate pages to the exact subject.It means pages are sub items of subjects.for this I want to create a relationship with two tables(subjects and pages)in the subject table it has field called id with the primary key.And for creating the relationship I created a new field in the pages table called subject_id.so I'm trying to create the relationship with these two fields.Are there any other way of doing this?I mean for creating a navigation menu with sub menu items.
  3. <?php $result =mysql_query("SELECT * FROM subjects",$connection); if(!$result){ die("connection error : ".mysql_error()); } while($row = mysql_fetch_array($result)){ echo $row["menu_name"]."<br/>"; } $q = "SELECT * FROM pages WHERE subject_id = {$row['id']}"; $parent = mysql_query($q,$connection); if(!$parent){ die("connection error : ".mysql_error()); } while($rowone = mysql_fetch_array($parent)){ if($parent==$row["id"]){ echo $rowone["menu_name"]; } } ?> This is the error message.
  4. error message is the same.I mentioned above it.
  5. still it isn't working friend..
  6. $q = "SELECT * FROM pages WHERE subject_id = {$row['id']"; this line has the error.
  7. <?php $result =mysql_query("SELECT * FROM subjects",$connection); if(!$result){ die("connection error : ".mysql_error()); } while($row = mysql_fetch_array($result)){ echo $row["menu_name"]."<br/>"; } $parent = mysql_query("SELECT * FROM pages WHERE subject_id = {$row['id']}" ,$connection); if(!$parent){ die("connection error : ".mysql_error()); } while($rowone = mysql_fetch_array($parent)){ if($parent==$row["id"]){ echo $rowone["menu_name"]; } } ?> please help me this is the error message
  8. <?php require_once("includes/connection.php");?> <html> <head> <style type="text/css"> <!-- a:link { color: #000000; text-decoration: none; } a:visited { text-decoration: none; color: #000000; } a:hover { text-decoration: underline; color: #FFFFFF; } a:active { text-decoration: none; color: #000000; } a { font-family: Courier New, Courier, monospace; } body,td,th { font-family: Courier New, Courier, monospace; font-size: 18px; } .style1 {font-size: 40px} #one { text-align:center; vertical-align:top; } #parent { position:absolute; left:60px; font-size:14px; } --> </style> </head> <body> <table width="100%" height="888" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="186" colspan="2" bgcolor="#CCCCCC"><div align="center" class="style1">DOWNLOAD TREASURE </div></td> </tr> <tr> <td id="one" width="16%" bgcolor="#99CCFF" ><?php $result =mysql_query("SELECT * FROM subjects",$connection); if(!$result){ die("connection error : ".mysql_error()); } while($row = mysql_fetch_array($result)){ echo $row["menu_name"]."<br/>"; } $parent = mysql_query("SELECT * FROM pages WHERE subject_id = {$row["id"]}" ,$connection); if(!$parent){ die("connection error : ".mysql_error()); } while($rowone = mysql_fetch_array($parent)){ echo $rowone["menu_name"]; } ?></td> <td width="84%"> </td> </tr> </table> </body> </html> is there any mistake here.it is a big help for me.
×
×
  • 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.