I just want to display a row only if the result is not null. When I process the page It doesn't display the table rows at all. I am new to php and I am using Dreamweaver to generate the code. Based on previous threds I know this is not the recommended way among the hand coders but I am far from knowledgeable enough to hand code myself. I did buy a book and i am slowly learning. Thanks.
The only code I changed is the code after the body tag.
<?php
//Connection statement
require_once('../Connections/connupdate.php');
// begin Recordset
$colname__rssetup = '-1';
if (isset($HTTP_GET_VARS['user_name'])) {
$colname__rssetup = $HTTP_GET_VARS['user_name'];
}
$query_rssetup = sprintf("SELECT * FROM setup WHERE user_name = '%s'", $colname__rssetup);
$rssetup = $connupdate->SelectLimit($query_rssetup) or die($connupdate->ErrorMsg());
$totalRows_rssetup = $rssetup->RecordCount();
// end Recordset
//PHP ADODB document - made with PHAkt 2.4.0?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
echo "<table width='50%' border='0' cellspacing='0' cellpadding='0'>";
if ( $mobo != "" )
{
echo "<tr><td>motherboard</td><td>$rssetup->Fields('mobo');</td></tr>";
}
if ( $ram != "" )
{
echo "<tr><td>ram</td><td>$rssetup->Fields('ram');</td></tr>";
}
if ( $video_card != "" )
{
echo "<tr><td>video card</td><td>$rssetup->Fields('video_card');</td></tr>";
}
?>
</table>
</body>
</html>
<?php
$rssetup->Close();
?>
The only code I changed is the code after the body tag.
<?php
//Connection statement
require_once('../Connections/connupdate.php');
// begin Recordset
$colname__rssetup = '-1';
if (isset($HTTP_GET_VARS['user_name'])) {
$colname__rssetup = $HTTP_GET_VARS['user_name'];
}
$query_rssetup = sprintf("SELECT * FROM setup WHERE user_name = '%s'", $colname__rssetup);
$rssetup = $connupdate->SelectLimit($query_rssetup) or die($connupdate->ErrorMsg());
$totalRows_rssetup = $rssetup->RecordCount();
// end Recordset
//PHP ADODB document - made with PHAkt 2.4.0?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
echo "<table width='50%' border='0' cellspacing='0' cellpadding='0'>";
if ( $mobo != "" )
{
echo "<tr><td>motherboard</td><td>$rssetup->Fields('mobo');</td></tr>";
}
if ( $ram != "" )
{
echo "<tr><td>ram</td><td>$rssetup->Fields('ram');</td></tr>";
}
if ( $video_card != "" )
{
echo "<tr><td>video card</td><td>$rssetup->Fields('video_card');</td></tr>";
}
?>
</table>
</body>
</html>
<?php
$rssetup->Close();
?>