I have a linux box running php4.2.3 and a my webhost is running 4.3.1
The following code works on my webhost, but not on my linux box - (the IF statement at the end) Would this have anything to do with the configure command used to install php?
<?php
$username="username";
$password="password";
$database="db";
$db=mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die ("Unable to connect!");
$query=("SELECT * FROM horse");
$result=mysql_query($query);
$num=mysql_numrows($result);
echo "<b><center>Select a horse to view</b></center><br><br>";
$i=0;
while ($i < $num) {
$reg_num=mysql_result($result,$i,"reg_num");
$reg_name=mysql_result($result,$i,"reg_name");
$nickname=mysql_result($result,$i,"nickname");
$bdate=mysql_result($result,$i,"bdate");
$sire=mysql_result($result,$i,"sire");
$dam=mysql_result($result,$i,"dam");
echo ("<table><tr><td><a
href=$PHP_SELF?show=$reg_num>$reg_name</a></td><td>$nickname</td></tr></table><br>");
++$i;
}
if ($show) {
$sql=mysql_query("SELECT * FROM horse WHERE reg_num=$show");
$row=mysql_fetch_array($sql);
printf ("%s \n",$row["sire"]);
}
?>