Thread: Use a Function
View Single Post
Old 02-09-2013, 09:36 PM   PM User | #5
ROYW1000
Regular Coder

 
Join Date: Jan 2010
Posts: 151
Thanks: 10
Thanked 1 Time in 1 Post
ROYW1000 is an unknown quantity at this point
Hi

As soon as I enter this code onto the page it stops working and Dreamweaver shows a syntax error. What am I doing wrong?

PHP Code:
function &showQueries()
{
    return 
"Total Queries: " $this->queriesRun;
}
  
$var = &$obj->showQueries(); 
Its this part that causes the error.

$var = &$obj->showQueries();

I think if this works this example will be very good.

Thanks in advance for your help.

Roy
ROYW1000 is offline   Reply With Quote