I have this code which worked on my old server. I think it's a little outdated. I'm transferring it to a new server and it's not working (though running the same version of PHP)
I've tested to make sure that the SQL query came through correctly and it did so it's got to be something with my old syntax. (I hope)
// Make the query.
$query = "SELECT job_title AS t, job_desc AS d, job_locate AS l, job_id AS id FROM Architects WHERE job_id = '$edit'";
$result = @mysql_query ($query); // Run the query.
if ($result) { // If it ran OK, display the records.
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo '<h3 align="center">Edit Job Listing</h3>
<form action="edit.php" method="post">
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td align="left" valign="top"><input name="id" type="hidden" value="'. $row[3] .'"><b>Job Title:</b> </td>
<td align="left" valign="middle"><input type="text" name="title" size="40" maxlength="100" value="'. $row[0] .'" /></td>
</tr>
<tr>
<td align="right" valign="top" class="td_small"><b>Description:</b></td>
<td align="left" valign="middle"><textarea name="descript" rows=7 cols=40 >'. $row[1] .'</textarea></td>
</tr>
<tr>
<td align="left" valign="top"><b>Job Location:</b> </td>
<td align="left" valign="middle"><input type="text" name="locate" size="40" maxlength="255" value="'. $row[2] .'" /></td>
</tr>';
}
echo '</table><p align="center"><input type="submit" name="submit" value="Submit" /></p></form>';
mysql_free_result ($result); // Free up the resources.
} else { // If it did not run OK.
echo '<p>The job could not be displayed due to a system error. We apologize for any inconvenience.</p><p>' . mysql_error() . '</p>';
}
I'm not receiving any errors just a page that's got the header and footer but otherwise empty???