Posted by Denis Gerina on 06/04/07 22:09
vinnie wrote:
>> Change this
>> echo'<br><br>here are the results: $num_results';
>> to this
>> echo '<br><br>here are the results: '.$num_results;
>>
>
> thanks Geoff, it works perfectly now. But what's the difference? Is
> not the same thing?
>
The difference is that unlike double-quoted strings, single-quoted
strings do not replace variable names inside the quotes with variable
values. The version that works concatenates your string with the value
of $num_results variable.
You could also have written
echo "<br><br>here are the results: $num_results";
[Back to original message]
|