<?php
Require ("dbconnection.php");
$i = 1;
$group=$_POST["Group"];
$stream=$_POST["Stream"];
$certification=$_POST["Certification"];
$sql="SELECT GROUP_NAME
FROM emp_data
WHERE Group_id = '$group'
AND Stream_id = '$stream'
AND certification = '$certification'";
echo $sql;
if (!mysql_query(sql,$db))
{
die('Error Occured: ' . mysql_error());
}
$result = mysql_query( $sql );
$num_of_rows = mysql_num_rows($result);
?>
<form name="frm1" action= "Emp_Certi.php" >
<?php
echo "<table border='1'>";
echo "<tr><td><B>Groups</B></td></tr>";
if (mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_array($tech_result))
{
echo "<tr>";
?>
<input type="radio" name="radiobutton[]" value="radiobutton">
<?php
echo "<td>" . $row['GROUP_NAME'] . "</td>"; echo "<br>";
echo "</tr>";
$i=$i+1;
}
}
else
echo "No groups found";
?>
<input type="submit" value="Submit" name="Submit" />
<?php
echo "</table>";
echo "</form>";
mysql_close($db);
?>
this is not wrking
the output as
SELECT GROUP_NAME FROM emp_data WHERE Group_id = 'tttttt' AND Stream_id = 'yyyyy' AND certification = 'xxxxx'Error Occured: 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 'sql' at line 1
i m using php n mysql ... nt able to write proper sql wch can run in a php script..
please help
hw cld i chg it?