Beginners syntax and loop questions - help please!

Posted on 16th Feb 2014 by admin

Hi everyone,

I have some problems with php code. I'm currently in the middle of learning php, but these problems have got me stuck fast. But also have a question regarding looping that i'll ask in the same thread:

Firstly, I keep getting various syntax errors with my table:

PHP Code:
Code: echo "
<table border='1' bordercolor='#FFCC00'>
<style='background-color:#FFFFFF' width='800' cellpadding='3' cellspacing='3'>
<tr>
<td width='200' align='left' rowspan=5>Image</td>
</tr>
<tr>
<td width='573' align='left'>'Name:$row_details['MerchantName']</td>
</tr>
<tr>
<td height='27' align='left'>Telephone:$row_details['Telephone']</td>
</tr>
<tr>
<td height='27' align='left'>Website:$row_details['Website']</td>
</tr>
<tr>
<td height='54' align='left'>Description:$row_details['Description']</td>
</tr>

</html></body></table>"; it keeps telling me its expecting ";" or "," in various place along with T_Lnumber errors as i mentioned, i'm brand new to coding so im not sure whats happening there, the books and forums I've read dont point to these errors.

Also, I'm not sure if $row_details[''] is the correct code to display results from the database?

And the loop question I have is: Is it possible to get that little table above (once its working) to display 5 times per page. (and i suppose recognise that it need a new page if there more than 5 results)

Sorry this is a huge post but I've been trial and erroring for 2 days and its time to call in the pro's.

Other forums