Forum Moderators: coopster

Message Too Old, No Replies

Get a blank page with no info.?

Works on my PC but not on server

         

JSoaper

7:57 am on Mar 30, 2009 (gmt 0)

10+ Year Member



I use the following code on my PC using Vertrigo Server and Windows XP and it works perfectly - the code is used to update an existing record - however when I load it on to my server I get blank page when this code is called:

===========================================================
Code here below
===========================================================
<?
include("dbinfo.inc.php");
include("header.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM salesreport WHERE sid='$sid'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();

$i=0;
while ($i < $num) {
$date=mysql_result($result,$i,"date");
$company=mysql_result($result,$i,"company");
$feedback=mysql_result($result,$i,"feedback");
$callback=mysql_result($result,$i,"callback");
$contact=mysql_result($result,$i,"contact");
$tel=mysql_result($result,$i,"tel");
$cell=mysql_result($result,$i,"cell");
$fax=mysql_result($result,$i,"fax");
$email=mysql_result($result,$i,"email");
$website=mysql_result($result,$i,"website");

?>

<form action="updated.php">
<input type="hidden" name="sid" value="<? echo "$sid"; ?>">
<div align="center">

<table border="0" width="780">
<tr>
<td align="left" width="99" >Date</td>
<td align="left"><input type="text" name="date" value="<? echo "$date"?>"></td>
</tr>
<tr>
<td align="left" width="99">Company</td>
<td align="left"><input type="text" name="company" value="<? echo "$company"?>"></td>
</tr>

<tr>
<td td align="left"width="99">Callback</td>
<td align="left"><input type="text" name="callback" value="<? echo "$callback"?>"></td>
</tr>
<tr>
<td td align="left" width="99">Contact</td>
<td align="left"><input type="text" name="contact" value="<? echo "$contact"?>"></td>
</tr>
<tr>
<td align="left" width="99">Telephone</td>
<td align="left"><input type="text" name="tel" value="<? echo "$tel"?>"></td>
</tr>
<tr>
<td align="left" width="99">Cell</td>
<td align="left"><input type="text" name="cell" value="<? echo "$cell"?>"></td>
</tr>
<tr>
<td align="left" width="99">Fax</td>
<td align="left"><input type="text" name="fax" value="<? echo "$fax"?>"></td>
</tr>
<tr>
<td align="left" width="99">Email</td>
<td align="left"><input type="text" name="email" value="<? echo "$email"?>"></td>
</tr>
<tr>
<td align="left" width="99">Web</td>
<td align="left"><input type="text" name="website" value="<? echo "$website"?>"></td>
</tr>
<tr>
<td align="left" width="99">Feedback</td>
<td align="left"><textarea name="feedback" rows="7" cols="150"><? echo $feedback; ?></textarea></td>

</tr>
<tr>
<td align="left" width="99">&nbsp;</td>
<td align="left"><input type="Submit" value="Update">
</form></td>
</tr>
</table>

<?
++$i;
}
?>

===========================================================

Any advice greatly appreciated.

darrenG

3:06 pm on Mar 30, 2009 (gmt 0)

10+ Year Member



i would guess that there is an error somewhere, and errors are switched off on the live box

d40sithui

3:10 pm on Mar 30, 2009 (gmt 0)

10+ Year Member



Could be a few things.
Is your error reporting setting off?
Do you have data in your tables?
Where is $sid initiated?
$num=mysql_numrows($result) should be $num=mysql_num_rows($result). This is a php error syntax. If you have error reporting off, the script will end here. Nothing gets displayed and everything below this line will not be processed.
Also, it doesn't look like you need to loop since you will only be getting 1 result set back using the $sid.

JSoaper

10:50 am on Mar 31, 2009 (gmt 0)

10+ Year Member



Thanks for the suggestions it works now.