Retarded profileID variable

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?

caredesign.net
Quote · 14 Aug 2013

Also - when i add the $profileID = getID( $_GET['ID'] ); - it is no longer not displaying the block if it is empty - instead, it is showing the block with the Header. Screenshot below

empty block.png · 48.3K · 153 views
caredesign.net
Quote · 14 Aug 2013

Knock Knock.

caredesign.net
Quote · 18 Aug 2013

 

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?

It has something to do with the classes. I don't get it either, but you don't have to get it. Just include the needed code and forget it.

You should not be having a problem with it but i can't test it myself. The table services is obviously not part of a default dolphin install, so no one is going to be able to test the code.

I would suggest a if($services) check be done before your loop so it makes no attempt to process if the content of services is empty.

It should also have a check for the profile id. So it aborts if the profile id is 0.


https://www.deanbassett.com
Quote · 18 Aug 2013

Also. I do not see the variable $row_count for the line $row_count++; being used anywhere.

If this all of your code?


https://www.deanbassett.com
Quote · 18 Aug 2013

Tried using this to get the id of the viewed profile?

$this->oProfileGen->_iProfileID

so much to do....
Quote · 18 Aug 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.