syntax when displaying row data out of a loop

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
emelianenko
Forum Commoner
Posts: 35
Joined: Thu Sep 09, 2010 11:49 am

syntax when displaying row data out of a loop

Post 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
mikecampbell
Forum Commoner
Posts: 38
Joined: Tue Oct 12, 2010 7:26 pm

Re: syntax when displaying row data out of a loop

Post 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']).'">'; 
emelianenko
Forum Commoner
Posts: 35
Joined: Thu Sep 09, 2010 11:49 am

Re: syntax when displaying row data out of a loop

Post 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!
mikecampbell
Forum Commoner
Posts: 38
Joined: Tue Oct 12, 2010 7:26 pm

Re: syntax when displaying row data out of a loop

Post by mikecampbell »

Post Reply