warrenk Posted August 6, 2006 Share Posted August 6, 2006 I am trying to create a 2 column table and keep getting a error...Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' in /home/reviews/public_html/brand1.php on line 16The line in error is:echo "<table width="180" border="1" cellspacing="2" cellpadding="0">";Here is some of the code...$result = mysql_query("select * from brands");$count = 1; $column = 1; echo "<table width="180" border="1" cellspacing="2" cellpadding="0">";//grab all the contentwhile($r=mysql_fetch_array($result)){ // first column displayif ($column == 1) { //field is the column in your tableprintf("<tr><td>%s</td>",$r["brand_name"]); }else{ //second column display printf("<td>%s</td></tr>",$r["brand_name"]); } $count += 1; $column = $count % 2; } echo "</table>"; Link to comment https://forums.phpfreaks.com/topic/16726-trouble-creatine-two-column-table/ Share on other sites More sharing options...
ignace Posted August 6, 2006 Share Posted August 6, 2006 change [code]echo "<table width="180" border="1" cellspacing="2" cellpadding="0">";[/code]to[code]echo "<table width='180' border='1' cellspacing='2' cellpadding='0'>";[/code]when you open something with ", then make sure whenever you again need something between quotes, then use ' because when you use " again, it means your closing it..so this[code]echo "<table width="180" border="1" cellspacing="2" cellpadding="0">";[/code]would only work if you would do this[code]echo "<table width=" . 180 . " border=" . 1 . " cellspacing=" . 2 . " cellpadding=" . 0 . ">";[/code] the . means your attaching it. Link to comment https://forums.phpfreaks.com/topic/16726-trouble-creatine-two-column-table/#findComment-70315 Share on other sites More sharing options...
warrenk Posted August 6, 2006 Author Share Posted August 6, 2006 Your replay couldn't of come more then a minute after I posted the question. :oReally appreciate your help....and fast reply!!!! Link to comment https://forums.phpfreaks.com/topic/16726-trouble-creatine-two-column-table/#findComment-70316 Share on other sites More sharing options...
ignace Posted August 6, 2006 Share Posted August 6, 2006 we didn't get the name of best php forum, not for nothing... ofcourse i'm not the one getting any credit for this, this goes to the guys that started phpfreaks.com Link to comment https://forums.phpfreaks.com/topic/16726-trouble-creatine-two-column-table/#findComment-70318 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.