2
Colleagues...
I have a method that brings the results of a table. So far so good. What is intriguing me is that after I changed server, the structure of this method is the same for two other results and they work perfectly, but when creating another method with the same structure, it does not return value, except when there is only one value in the database. I have copied and pasted the structure of the functional method, replacing only the name of the method and nothing. But when I echo instead of Return, the result appears. Therefore, I isolated the code in another file and in a simple example, the error appears. Look at a simple function:
function teste(){
for($i = 0; $i < 10; $i++){
$c = $i;
}
return $c;
}
echo teste();
The result appears only 9. However when I echo. Returns the values correctly:
function teste(){
for($i = 0; $i < 10; $i++){
$c = $i;
echo $c;
}
}
echo teste();
Does anyone know why this happens?
Some of the answers was useful to you? if not post what did not work post what is still happening if yes validate a reply.
– Ricardo