Hi, All,
I'm pretty new to PHP. I was working on a site for a friend, because I know some html and before I got there he had changed some code. He insists that he only changed some text, but I don't believe him. (Also, side note: I am almost tempted to rebuild the footer-file, because I just don't get why it is written this way.)
Anyway the error I get now is: Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' on line 19
I tried reading through to find my problem, but I couldn't figure it out. So I just played around sticking commas and semi colons to end lines, and then removing them and putting them other places. To NO avail. Anyway, I tell you all this because I want you to know that I have tried.
So this is what the code looks like right now:
</tr>
<tr><td colspan="5"><br><font size="2"><!-- #BeginLibraryItem "/layout/footermenu.lbi" -->
</font><div align="center"><span class="style3"><font size="2">
<?php
mysql_connect("host","user","pass");
@mysql_select_db("smokeshop") or die("Unable to connect to database!");
$categories = mysql_query("select * from product order by id");
$cnt = 0;
while($cnt < mysql_numrows($categories)){
$url = mysql_result($categories,$cnt,"static_url");
if(mysql_result($categories,$cnt,"static") == 0){
$url = "/category.php?id=".mysql_result($categories,$cnt,"id");
}
$name = mysql_result($categories,$cnt,"name");
echo "<a href=¥"$url¥">$name</a> | ";
$cnt++;
}
?><a href="/directions/directions.php">Directions</a> | <a href="/order/order.php">Ordering Information</a></font></span><font size="2"></br>
<span class="style1">Copyright © 1999-2012 The Smoke Shop</span></font></div>
<!-- #EndLibraryItem --><center></center></td></tr>
</tbody></table>
<p> </p>
</body></html>
Any thoughts?
Post-script: The thing my friend was trying to do what update the copyright year. Would the code:
<div id="copyright">
Copyright © 1999 - <?php echo date('Y');?> The Smoke Shop
</div>
Do that automatically?
Anyway - I know I'm being a pain, and I'm sure I'm missing something obvious, but a second (or tenth) set of eyes would be so helpful.
Thank you all so much!