Thank you again so very much. I took your recomedation, changed all the PRINT to ECHO and made the other changes. I seem to be stuck on this problem. I can understand the logic in your statemnts and they make perfect sense to me. More sense than anything Ive found so far. This project is just not working for me 🙂 Welcome3 stayed the same, Welcome 4 is now blank white (If I undo the changes, it comes back, but even thouhg it will come back its non funtional) If you have a moment please look at these files. Whatever changes you suggest, I will try. If can get over this, everything else will fall into place. Working in IT for years, I know moments (especailly "FREE" moments dont come around. I will continue working. ANy more help will be treasured.
Welcome3:
$db = 'soclh';
$table = 'main';
mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
$query = "SELECT *
FROM $table
ORDER BY congress_number";
$result = mysql_query($query);
$number = mysql_num_rows($result);
echo "<table cellpadding=5>
<tr bgcolor=\"lightgrey\">
<td>
<b>Select one of the following:</b>
</td>
</tr>
</table>
<ul>";
echo '<ul>';
for($i=0; $i<$number; $i++)
while ($row = mysql_fetch_array($result)) {
echo '<li><a href="Welcome4.php?id=' . $row['id'] . '">' . $row['congress_number'] . '</a> ' . $row['year_s'] . '</li>';
}
echo '</ul>';
// Close the database connection
mysql_close();
?>
</body>
</html>
Welcome4:
$db = 'soclh';
$table = 'main';
mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
// check that there is an id
if (isset($GET['id'])) {
$sql = "SELECT * FROM $table WHERE id=$GET['id']";
// and run the query and display the results
}
$result = mysql_query($query);
$number = mysql_numrows($result);
echo "<h2>Select the title of the law you are interensted in:</h2>";
echo "<table cellpadding=5>";
echo " <tr bgcolor=black>
<td><font color=white><b>Congress Number</b></font></td>
<td><font color=white><b>Year/s</b></font></td>
<td><font color=white><b>Public Law Number</b></font></td>
<td><font color=white><b>Title Of Public Law</b></td></font></tr>";
for($i=0; $i<$number; $i++) {
$congress_number = mysql_result($result, $i, "congress_number");
$year_s = mysql_result($result, $i, "year_s");
$public_law_number = mysql_result($result, $i, "public_law_number");
$title_of_public_law = mysql_result($result, $i, "title_of_public_law");
if ($i%2 == 0) {
echo "<tr bgcolor=lightgrey>";
} else {
echo "<tr>";
}
echo "<td>$congress_number</td>
<td>$year_s</td>
<td>$public_law_number</td>
<td><a href=\"Welcome5.php?Id=$Id\">
$title_of_public_law</</td></tr>";
}
echo "</table>";
// Close the database connection
mysql_close();
?>
</body>
</html>