Current location: Hot Scripts Forums » Programming Languages » PHP » scripts wont work when running redhat 9.0


scripts wont work when running redhat 9.0

Reply
  #1 (permalink)  
Old 04-11-04, 06:53 PM
tgarske tgarske is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
scripts wont work when running redhat 9.0

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 &copy
2003 Garske Properties LLC. All rights are
reserved</font></td>
<td style=padding-left:20 class=black><a href=/>HOME</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href=../about>ABOUT US</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href=../service>SERVICE</a>&nbsp;&nbsp;&nbsp;|&nbsp;<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>";

} ;

?>
Reply With Quote
  #2 (permalink)  
Old 04-12-04, 07:03 AM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
I don't get it, where are you getting the $line[] variables from? i think your missing a line after... $total_rows
[php]
while($line = mysql_fetch_array($result))
{
[/code]

and then at the end end the while loop (or w/e)
That should be your problem
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Art Nexus seeking PHP programmers TheArtNexus Job Offers & Assistance 5 02-26-08 03:08 AM
running 2 scripts skipper23 JavaScript 5 01-20-04 07:53 PM
libgd2 and RedHat 9 clintec PHP 1 09-02-03 08:04 AM
Running Perl scripts under Microsoft IIS retrocom Perl 3 08-23-03 04:38 PM


All times are GMT -5. The time now is 10:25 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.