Jump to content

php echo mysql syntax help


SN1P3R_85

Recommended Posts

Hi, i want to echo a table, and in the table, i have links to certain pages. Each page name is stored in an sql database. I tried to write it, but i keep getting syntax errors. This is what i have:

 

echo "<table class=\"forum\" border=\"1\" width=\"40%\"><tr style=\"height:20px\"><td class=\"forum\" width=\"50%\"><a href=\"/forum/" . $row['Thread_name'] . "_" . $row['Id'] . ".php\">$row['Thread_name']</a></td></tr>";

 

p.s. - i end the table somewhere else, so don't worry about that.

Link to comment
https://forums.phpfreaks.com/topic/123533-php-echo-mysql-syntax-help/
Share on other sites

Instead of having the outer echo be a double quote I did a single quote and removed all of the \"

 

If your going to place HTML inside of an echo, the best way would be to use a single quote in my opinion, not a double quote. It makes for less errors.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.