I recently installed Redhat 9.0. After copying my pages to the new server, I noticed most of my PHP/MySQL calls will not work. I don’t' get any errors, it just returns no results. Even though there is data in my tables. The same scripts will run in Redhat advanced server 2.1 and 3.0. Has anyone run into this problem? Is there something redhat prohibits within PHP in 9.0? Below is snippet of one that will run on my 9.0 and one that won't.
WORKS in REDHAT 9.0
<?
require 'common.inc';
$link = mysql_connect("$DB_SERVER", "$DB_LOGIN", "$DB_PASSWORD");
mysql_select_db("$DB");
$result = mysql_query("select * from user_profile");
while($line = mysql_fetch_array($result))
{
echo "<tr><td vAlign=top bgColor=e3e3e3 align=left nowrap><font color=000080 size=3>";
echo $line["name"];
echo "<td vAlign=top bgColor=e3e3e3 align=left nowrap>";
echo $line["last_name"];
echo "<td vAlign=top bgColor=e3e3e3 align=left nowrap>";
echo $line["user_id"];
echo "<td vAlign=top bgColor=e3e3e3 align=left nowrap>";
echo $line["phone"];
echo "<td vAlign=top bgColor=e3e3e3 align=left nowrap>";
echo $line["rental"];
echo "</td></tr></font>";
}
?>
DOESN'TWORK in REDHAT 9.0
<?php
require 'common.inc';
echo "<table cellSpacing=0 cellPadding=3 width=100% border=1 bordercolor=808080>";
$link = mysql_connect("$DB_SERVER", "$DB_LOGIN", "$DB_PASSWORD");
mysql_select_db("$DB");
$result = mysql_query("select * from properties WHERE city ='$form_city'");
$total_rows = mysql_num_rows($result);
if (!$total_rows) {
echo "<table border=0 width=30% height=5 cellspacing=0 cellpadding=0>";
echo "<td width=20% height=5 bgcolor=#FFAD01><font size=2 color=#000080>No Properties Found</td>";
echo"</tr></table></td></tr><tr><td colspan=2 height=42 background=../images/footer.jpg>
<table border=0 cellpadding=0 cellspacing=0><tr>
<td style=padding-left:20><font style=font-size:10;color:000000>Copyright ©
2003 Garske Properties LLC. All rights are
reserved</font></td>
<td style=padding-left:20 class=black><a href=/>HOME</a> | <a href=../about>ABOUT US</a> | <a href=../service>SERVICE</a> | <a href=../contact>CONTACT US</a></td>
</tr></table></tr></table></td><td width=50% background=../images/bg_lft.gif></td></table>";
return;
}
echo "<table border=0 width=73% height=5 cellspacing=0 cellpadding=0>";
echo "<td width=30% height=5 bgcolor=#FFAD01><font size=1 face=Verdana,Helvetica,Arial color=#000080>Address</td>";
echo "<td width=30% height=5 bgcolor=#FFAD01><font size=1 face=Verdana,Helvetica,Arial color=#000080>City</td>";
echo "<td width=10% height=5 bgcolor=#FFAD01><font size=1 face=Verdana,Helvetica,Arial color=#000080>Beds</td>";
echo "<td width=10% height=5 bgcolor=#FFAD01><font size=1 face=Verdana,Helvetica,Arial color=#000080>Baths</td>";
echo "<td width=10% height=5 bgcolor=#FFAD01><font size=1 face=Verdana,Helvetica,Arial color=#000080>Rent</td>";
echo "<td width=10% height=5 bgcolor=#FFAD01><font size=1 face=Verdana,Helvetica,Arial color=#000080>Square Footage</td>";
echo "</table>";
while ( $line = mysql_fetch_array($result) ) {
echo "<table border=0 width=73% height=30 cellspacing=0 cellpadding=0>";
echo "<td width=30% height=30 bgcolor=#4963A0><font size=1 face=Verdana,Helvetica,Arial ><a href=../properties/default.php?id="; echo $line["prop_id"]; echo"><font color=#FFFFFF>"; echo $line["address"]; echo"</a></td>";
echo "<td width=30% height=30 bgcolor=#4963A0><font size=1 face=Verdana,Helvetica,Arial >"; echo $line["city"]; echo"</td>";
echo "<td width=10% height=30 bgcolor=#4963A0><font size=1 face=Verdana,Helvetica,Arial >"; echo $line["beds"]; echo"</td>";
echo "<td width=10% height=30 bgcolor=#4963A0><font size=1 face=Verdana,Helvetica,Arial >"; echo $line["baths"]; echo"</td>";
echo "<td width=10% height=30 bgcolor=#4963A0><font size=1 face=Verdana,Helvetica,Arial >"; echo $line["rent"]; echo"</td>";
echo "<td width=10% height=30 bgcolor=#4963A0><font size=1 face=Verdana,Helvetica,Arial >"; echo $line["square_feet"]; echo"</td>";
} ;
?>