I am trying to select a row form StudyCenter Table form the data selected in project table. I get the Error on this code. This is my code
<html>
<head>
<title>table</title>
</head>
<body>
<?php
$v_name = JRequest::getString('v_name', '', 'get');
if ( $v_name )
{
$result = mysql_query( "SELECT Project_Name,fabrik_internal_id,Activity_Name,Description FROM Project where fabrik_internal_id = $db->quote($v_name) ")
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
//print "There are $num_rows records.<P>";
print "<table width=400 border=0>\n";
print "<th> Project Name </th>";
print "<th> Project Number </th>";
print "<th> Activity Name </th>";
print "<th> Description </th>";
while ($get_info = mysql_fetch_row($result))
{
print "<tr>\n";
print "<td>".$get_info[0]."</td>";
print "<td>".$get_info[1]."</td>";
print "<td>".$get_info[2]."</td>";
print "<td>".$get_info[3]."</td>";
$pname = $get_info[0];
print "</tr>\n";
}
print "</table>\n";
}
$v_name = JRequest::getString('v_name', '', 'get');
if ( $v_name )
{
$result = mysql_query( "SELECT Project.School_Name_Code,Project.Village, Project.Project_Academic_Year, Study_Center.Head_Masters_Name, Study_Center.Instructor_Name, Study_Center.Supervisor_Name, Study_Center.No_Male_Students+Study_Center.No_Female_Students, Project.Expected_Start_Date, Project.Expected_Complete_Date FROM Project,Study_Center WHERE Project.fabrik_internal_id = $db->quote($v_name) AND
Study_Center.project_id = '$pname' ")
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
//print "There are $num_rows records.<P>";
print "<table width=400 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
echo "<tr> <td>School Name:</td>". "<td> $get_info[0]</td>". "</tr><br/>";
echo "<tr> <td>Village:</td>". "<td> $get_info[1]</td>". "</tr><br/>";
echo "<tr> <td>Academic year:</td>". "<td>$get_info[2]</td>"."</td></tr><br/>";
echo "<tr> <td>Headmaster:</td>". "<td> $get_info[3]</td>"."</td></tr><br/>";
echo "<tr> <td>Studycenter Instructor:</td>". "<td> $get_info[4]</td>"."</td></tr><br/>";
echo "<tr> <td>Study Center Supervisor</td>". "<td> $get_info[5]</td>"."</td></tr><br/>";
echo "<tr> <td>Number of Students Enrolled</td>". "<td> $get_info[6]</td>"."</td></tr><br/>";
echo "<tr> <td>Started On</td>". "<td> $get_info[7]</td>"."</td></tr><br/>";
echo "<tr> <td>Estimated Completion</td>". "<td> $get_info[8]</td>"."</td></tr><br/>";
print "</tr>\n";
}
print "</table>\n";
}
?>
</body>
</html>
And I get the Error Like this.
Notice: Undefined variable: db in /home/osmodels/public_html/subdomains/shoaib4/components/com_chronocontact/chronocontact.html.php(180) : eval()'d code on line 10
Notice: Trying to get property of non-object in /home/osmodels/public_html/subdomains/shoaib4/components/com_chronocontact/chronocontact.html.php(180) : eval()'d code on line 10
Project Name Project Number Activity Name Description
This Is the Sample project 2 18 Study Centres Testing the componenets
Notice: Undefined variable: db in /home/osmodels/public_html/subdomains/shoaib4/components/com_chronocontact/chronocontact.html.php(180) : eval()'d code on line 42
Notice: Trying to get property of non-object in /home/osmodels/public_html/subdomains/shoaib4/components/com_chronocontact/chronocontact.html.php(180) : eval()'d code on line 42
Can You Pl Help me on this
Regards,
Shoaib.
😀