To all,
OMG, Sorry Sorry Sorry I just read my post after waking up, its horrible wht I have posted last, as I was in state of sleep looking for a quick fix, hence I did nt want to read that article in whole and let that make me go early to sleep. I do respect the fact it requires patience and time, but I am in a worse pit of snake problems which i do nt want to go into personal details.
Should have paid more attention to the error
I guess i was doing c+v in dreamland: It should read as:
$sql="SELECT attrb1 FROM table1"; //attrib1 coltype is int
$sql2="SELECT attrib2 FROM table2 WHERE attrib3=".$sql['attrb1'].;
@phporcaffeine: thank you and sorry
@mdjamato: yes the first query returns multiple queries. Secondly, no error msgs shown, simply a blank pg.
@Adam: i was looking for a quick fix, thru Ctrl+F.
Well with much reluctance I think i may hv to paste the code. here it is now:
//Prepare SQL Statement queryset
$sqlQuestion="SELECT questionid, questiontext FROM questions";
$resultQuestion = mysql_query($sqlQuestion);
// Write out the HTML for the page
?>
<html>
<body>
<form method="POST" action="process.php">
<!-- Write out the question Text -->
<table border="1" cellpadding="6">
<?php
while($row = mysql_fetch_array($resultQuestion ))
{
echo "<tr>";
echo "<td width=525>" . $row['questiontext'] . "</td>";
echo "Hello";
//Prepare statement to fetch options for each question as a queryset
$sqlOptions="SELECT options.optionid,options.optiontext,options.optionvalue FROM options,questions WHERE options.questionid=".$row['questionid']. ; //<------The error is here
$resultOption = mysql_query($sqlOptions);
/*while($col = mysql_fetch_array($resultOption))
{
if($row['questionid']==1)
{
echo "<td> <input name= " .$row['questionid']. " type=radio value=1/>" .$col[optiontext]. "</td>";
echo "<td> <input name= " .$row['questionid']. " type=radio value=0/>" .$col[optiontext]. "</td>";
}
else
{
echo "<td> <input name= " .$row['questionid']. " type=radio value=1/>" .$col[optiontext]. "</td>";
echo "<td> <input name= " .$row['questionid']. " type=radio value=0/>" .$col[optiontext]. "</td>";
}
}*/
echo "</tr>";
}
?>