Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.