I am having some problems here. I did this with dreamweaver and i get the following when i load it in my browser:
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Index = 1 ORDER BY Lastname ASC' at line 1"
I cant make out where the error is. Any help is appreciated.
This is the code:
<?php require_once('Connections/learning.php'); ?><?php
mysql_select_db($database_learning, $learning);
$recordID = $_GET['recordID'];
$query_DetailRS1 = "SELECT * FROM persons WHERE Index = $recordID ORDER BY Lastname ASC";
$DetailRS1 = mysql_query($query_DetailRS1, $learning) or die(mysql_error());
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
$totalRows_DetailRS1 = mysql_num_rows($DetailRS1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[
www.w3.org];
<html xmlns="[
www.w3.org];
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<table border="1" align="center">
<tr>
<td>Lastname</td>
<td><?php echo $row_DetailRS1['Lastname']; ?> </td>
</tr>
<tr>
<td>Firstname</td>
<td><?php echo $row_DetailRS1['Firstname']; ?> </td>
</tr>
<tr>
<td>Age</td>
<td><?php echo $row_DetailRS1['Age']; ?> </td>
</tr>
</table>
</body>
</html><?php
mysql_free_result($DetailRS1);
?>