alienmojo Posted February 7, 2007 Share Posted February 7, 2007 echo "<table border='5'> <tr> <th>Picture</th> <th><a href="results.php?sort=1">Price</a></th> <th><a href="results.php?sort=2">Baths</a></th> <th><a href="results.php?sort=3">Bedrooms</a></th> <th>State</th> <th>City</th> <th><a href="results.php?sort=4">Square Feet</a></th> </tr>"; theres my code thats the part getting this error Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in C:\Documents and Settings\marquis taliaferro\Desktop\web page\results.php on line 203 Link to comment https://forums.phpfreaks.com/topic/37408-syntax/ Share on other sites More sharing options...
fert Posted February 7, 2007 Share Posted February 7, 2007 change the " to \" Link to comment https://forums.phpfreaks.com/topic/37408-syntax/#findComment-178808 Share on other sites More sharing options...
Jessica Posted February 7, 2007 Share Posted February 7, 2007 Or: echo '<table border='5'> <tr> <th>Picture</th> <th><a href="results.php?sort=1">Price</a></th> <th><a href="results.php?sort=2">Baths</a></th> <th><a href="results.php?sort=3">Bedrooms</a></th> <th>State</th> <th>City</th> <th><a href="results.php?sort=4">Square Feet</a></th> </tr>'; If you want to use a " inside of a string, you need to either mark the string with ' or escape them like Fert said. Same for ' and \'. Link to comment https://forums.phpfreaks.com/topic/37408-syntax/#findComment-178810 Share on other sites More sharing options...
JasonLewis Posted February 7, 2007 Share Posted February 7, 2007 or, another answer: echo <<<html <table border='5'> <tr> <th>Picture</th> <th><a href="results.php?sort=1">Price</a></th> <th><a href="results.php?sort=2">Baths</a></th> <th><a href="results.php?sort=3">Bedrooms</a></th> <th>State</th> <th>City</th> <th><a href="results.php?sort=4">Square Feet</a></th> </tr> html; then you can use either.... just a question. is it supposed to be <th> or <td>? Link to comment https://forums.phpfreaks.com/topic/37408-syntax/#findComment-178950 Share on other sites More sharing options...
Gruzin Posted February 7, 2007 Share Posted February 7, 2007 Actually I use <td>, but you can also use <th>... Link to comment https://forums.phpfreaks.com/topic/37408-syntax/#findComment-178956 Share on other sites More sharing options...
JasonLewis Posted February 7, 2007 Share Posted February 7, 2007 well there you go, i always thought it was <td> only. is that new or old, because i learnt html like 7 years ago. Link to comment https://forums.phpfreaks.com/topic/37408-syntax/#findComment-178959 Share on other sites More sharing options...
Jessica Posted February 7, 2007 Share Posted February 7, 2007 <th> is a table header. HTML is a vast language, I'm sure there are many things you might not recognize - like fieldset and legend. Link to comment https://forums.phpfreaks.com/topic/37408-syntax/#findComment-178964 Share on other sites More sharing options...
JasonLewis Posted February 7, 2007 Share Posted February 7, 2007 nah i am quite familiar with those. very, actually. i am fairly experienced in html. i am quite good at tables, although i never heard of <th> before. odd. Link to comment https://forums.phpfreaks.com/topic/37408-syntax/#findComment-178966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.