I have this code in a php block on the profile page:
$services = mysql_query("SELECT * FROM services WHERE provider_id = '$profileID'");
while ($row_services = mysql_fetch_array($services)) {
$service_type = $row_services["service_type"];
echo $service_type;
$row_count++;
}
As is - it is not working. Confusing to me cause the variable is correct, and is created by the profile.php page itself. If I replace the $profileID with an actual user id then the contents are displayed correctly.
Now, if I add:
$profileID = getID( $_GET['ID'] );
to the beginning of my code block - then it works perfectly. I dont understand this as that code is already included on the profile.php page - so why should I have to include it in my code block also?