"Maciej Nadolski" <us****@WYTNIJ-TO.nadolski.net> wrote in message
news:Xn*******************************@193.110.122 .80...
Hi!
I`ve got a simple question but I`m puzzled:( When I create variable: for
example $query for query to MySQL its obvieus that I want to use variables. Now
should I do something like that:
1) $query = "blahblahblah".$variable1."blahblahblah"
."blahblahblah".$variable2."blahblahblah";
OR
2) $query = "blahblahblah."$variable1."blahblahblah"
."blahblahblah."$variable2."blahblahblah";
It`s the 1st one right? I have to be sure:(
TIA
--
Best regards,
Maciej Nadolski
RTFM. If you did you would see that 1 is valid php and 2 is not, but that
neither are partiularly efficient.
You are using double quotes where single would suffice:
$query = 'blahblahblah'.$variable1.'blahblahblahblahblahbla h'
.$variable2.'blahblahblah';
would be favourable. If you really wanted to use doube quotes (maybe your
keyboard is broken?) then you could use:
$query = "blahblahblah{$variable1}blahblahblah
{$variable2}blahblahblah";
but this will be slower as php will be parsing the pre-defined text as well.
PS
--
Divide By Cucumber Error. Please Reinstall Universe And Reboot