Page 1 of 1

syntax when displaying row data out of a loop

Posted: Fri Dec 17, 2010 3:18 am
by emelianenko
Hello,

just as you do something like this when you are displaying in a table the results of loop

Code: Select all


echo '<tr> .htmlspecialchars($row['email'])</tr>'  

I would like to include that email data in a more complete line that would be issued like this

Code: Select all

 
echo '<input type = "hidden" name = "country" value = ' " .htmlspecialchars($row['email']) "' >'; 
but I think I am not doing something right with the value part syntax of dots and quotes.

thanks a lot

Emy

Re: syntax when displaying row data out of a loop

Posted: Fri Dec 17, 2010 3:28 am
by mikecampbell
This is not valid syntax

Code: Select all

echo '<tr> .htmlspecialchars($row['email'])</tr>'
nor is this

Code: Select all

echo '<input type = "hidden" name = "country" value = ' " .htmlspecialchars($row['email']) "' >'; 
Your quotes need to be balanced. This will work...

Code: Select all

echo '<input type = "hidden" name = "country" value = "'.htmlspecialchars($row['email']).'">'; 

Re: syntax when displaying row data out of a loop

Posted: Fri Dec 17, 2010 4:21 am
by emelianenko
thank you very much!


is there anywhere I can learn the rules of dots single and double quotes or are there the few basic rules which always work ?

thank you!

Re: syntax when displaying row data out of a loop

Posted: Fri Dec 17, 2010 12:24 pm
by mikecampbell