I'm a beginner with PHP and mySQL and I'm using it for my project. I sort of have a problem with my query.
This is my code:
$doctname = mysql_query("SELECT name_of_doctor FROM {$table} WHERE department_no = '{$_REQUEST['deptno']}'");
$doctnamerow = mysql_fetch_row($doctname);
do
{
foreach ($doctnamerow as $cell)
{
$doctnamerowvalue = $cell;
}
} while ($doctnamerow = mysql_fetch_row($doctname));
So the problem I have is that if the doctor's name has a space between it (e.g "AJ Ramos") then it seems to skip the space and just returns "AJ" and not the surname. How do I do this? Thanks =)
edit:
Silly me, It was just an error with my code, I was using $doctnamerowvalue as a value=$doctnamerow for one of my text boxes and forgot to put double quotes, which resulted in value=doctor name and not value="doctor name". Sorry
?deptno='; DROP TABLE doctors;--foreachloop?