where is your mysql_connect ?
pritaeas
Posting Expert
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
this line should be like this:
$query=("select * from course where course='".$course."'") or die(mysql_error());
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
hello kishor..
echo this line and tel me wat u got:
echo $course=$_GET['course'];
and also echo this statement:
echo $r="select * from course where course='".$course."'";
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
so, you didn't get any data in $_GET['course'];
tel me ,from where you are getting this variable..
or post needed code...
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
see this, i have modified your code..
it is working fine now...
and i have write some more piece of code where they have needed to come out from errors..
<<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Small Corporation" />
<meta name="keywords" content="small, corporation" />
<link rel="stylesheet" href="style.css" type="text/css" />
<style type="text/css">
<!--
.style4 {color: #FFFFFF}
.style5 {color: #2D5181}
-->
</style>
</head>
<body>
<div id="contentcourse">
<div id="header"></div>
<ul id="menu">
<li><a class="current" href="index.php">Home</a></li>
<li><a href="aboutus.php">About Us</a></li>
<li><a href="courses.php">Courses</a></li>
<li><a href="demo_registration.php">Demo Class Registration</a></li>
<li><a href="faq.php">FAQ's</a></li>
<li><a href="order.php">How To Order</a></li>
<li><a href="payment.php">Payment Options</a></li>
<li><a href="enquiry.php">Enquiry</a></li>
<li><a href="contact.php">Contact Us</a></li>
</ul>
<div id="course">
<div id="title">
<h3>Sub Courses</h3>
</div>
<br/>
<?php
include("conn.php");
if(!empty($_GET['course']))
{
echo $course=$_GET['course'];
}else
$course='';
$query=("select course,subcourse from course WHERE course='".$course."'") or die(mysql_error());
$ress1=mysql_query($query);
while($rows=mysql_fetch_array($ress1))
{
$subcourse= $rows['subcourse'];
?>
<font color="#666666"> <a href="course.php?course=<?php echo $course ;?>&subcourse=<?php echo $subcourse ;?>" >
<?php
echo $subcourse;
echo "";
?>
</a></font>
<?php
}?>
<?php if(!empty($_GET['course']))
{ $course=$_GET['course'];
}
if(!empty($_GET['subcourse']))
{
$subcourse= $_GET['subcourse'];
}
else $subcourse='';
$ress2=mysql_query("select * from course where subcourse='".$subcourse."'") or die(mysql_error());
while($rows=mysql_fetch_array($ress2))
{
$subcourse= $rows['subcourse'];
$fee= $rows['fee'];
$content= $rows['content'];
?>
<table width="85%" border="1" bordercolor="#CCCCCC">
<tr >
<td width="14%" height="40" ><strong>Course:</strong></td>
<td width="86%" ><?php echo $subcourse; ?></td>
</tr>
<tr>
<td height="39"><strong>Fee:</strong></td>
<td><?php echo $fee; ?></td>
</tr>
<tr>
<td height="210"><strong>Discription:</strong></td>
<td><textarea rows="13" cols="50"><?php echo $content; ?></textarea>
</td>
</tr>
</table>
<?php } ?>
<p> </p>
</div>
<div id="title1">
<h3 class="style5">Courses Offered</h3>
</div>
<div id="sidemenu">
<p>
<?php
$ress=mysql_query("select DISTINCT course from course ") or die(mysql_error());
while ($row = mysql_fetch_array($ress))
{
$course= $row['course'];
?>
<a href="course.php?course=<?php echo $course ;?>" >
<?php echo $row['course'];
echo "";
}?> </a> </p>
</div>
<div id="footer"><br/>
<div align="center"><span class="links"><a href="index.php">Home</a>
<a href="aboutus.php">About Us</a>
<a href="courses.php">Courses</a>
<a href="demo_registration.php">Demo Class Registration</a>
<a href="faq.php">FAQ's</a>
<a href="order.php">How To Order</a>
<a href="payment.php">Payment Options</a>
<a href="enquiry.php">Enquiry</a>
<a href="contact.php">Contact Us</a></span></div>
</div>
</div>
</body>
</html>
Enjoy!!!!1
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
if your problem is solved...then make this thread as solved...then others will see for it...
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162