Hi All,
I am trying to get 2 pieces of data (Student ID and their name) to appear in a dropdown box. I have written the following code but keep getting the same error on the first echo statement:
$sql = "SELECT SK_ID, name FROM student";
$result = mysql_query($sql, $conn);
if(mysql_num_rows($result)) {
while($row = mysql_fetch_assoc($result)) {
echo ("<option value=\"$row['SK_ID']\">$row['SK_ID'] , $row['name']</option>");
}
} else {
echo ("<option value=\"\">No students created yet</option>");
}
Here is the error message;
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING ...
Any help appreciated
Regards,
K0108788