[SOLVED] Stupid Parse Errors!

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jslick
Forum Commoner
Posts: 35
Joined: Wed Jul 21, 2004 11:18 am

[SOLVED] Stupid Parse Errors!

Post by jslick »

I was making a PHP/MySQL script and ran into one of those annoying Parse errors. My PHP script:

Code: Select all

<?php
$link=mysql_connect("localhost","[b]username[/b]","[b]password[/b]");
$db=mysql_select_db("[b]database_name[/b]",$link);
$query="SELECT * FROM news_posts";
$result=mysql_query($query,$link);
$numrows=mysql_num_rows($result);
for($i=0; $i<$numrows; $i++){
$the_arrays=mysql_fetch_array($result);
print("<br /><h2 class="sub">$the_arrays['title']</h2>\n");
print("<br /><span style="font-size:8pt;">posted: <i>$the_arrays['date']</i>"
."\nID: <i>$the_arrays['id']</i></span>\n");
print("<br /><p>$the_arrays['posttext']</p>");
}
?>
My error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/slicknet/public_html/news/index.php on line 9

So it must be complaining about $the_arrays['title'].
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

{$the_arrays['title']} ....
jslick
Forum Commoner
Posts: 35
Joined: Wed Jul 21, 2004 11:18 am

Post by jslick »

Thanks so much feyd. I got it working. Hey, I found this today: http://www.javascriptkit.com/howto/htaccess.shtml
Post Reply