hey i have just started making a downloads script for my website as i wanted one coded by myself so i can say this website is all my own and no "powerd by" links anyware !
so i created a downloads module for my site and now for some odd reason i am getting this error.
Parse error: parse error, unexpected T_VARIABLE in c:\program files\apache group\apache\htdocs\modules\downloads\view.php on line 14
here is the code i have made up after salvaging parts of my news script.
<?php
include "config.php";
$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");
/* We have now connected, unless you got an error message */
/* Lets extract the data (news) from the database */
$query = "SELECT title, desc, dlink, fsize FROM php_downloads ORDER BY id DESC LIMIT 10";
$result = mysql_query($query);
/* Here we fetch the result as an array */
while($r=mysql_fetch_array($result)
/* This bit sets our data from each row as variables, to make it easier to display */
[b] $title=$r['title']; [/b]
$desc=$r['desc'];
$dlink=$r['dlink'];
$fsize=$r['fsize'];
/* Now lets display the news */
echo "<center><table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='59%' id='AutoNumber1'>
<tr>
<td width='50%' align='right'><font face='Verdana'>Download Title :</font></td>
<td width='50%'>$title</td>
</tr>
<tr>
<td width='50%' align='right'><font face='Verdana'>Download Description :</font></td>
<td width='50%'>$desc</td>
</tr>
<tr>
<td width='50%' align='right'><font face='Verdana'>Download Link :</font></td>
<td width='50%'>$dlink</td>
</tr>
<tr>
<td width='50%' align='right'><font face='Verdana'>Download Size :</font></td>
<td width='50%'>$fsize</td>
</tr>
</table></center><br>";
}
mysql_close($db);
?>
now when i look at this i think it looks fine but i would like to know how to fix this error i have made the line with the error stand out for easy viewing please help and thanks in advance !
i also expect that when this one is working lines 15, 16 and 17 will error on account that there the same with a few different words.
amongst giving me the answer to this could you please tell me what an unexpected T-String & T-Variable errors are thank you and good day !
EDITED BELOW THIS POINT !
this is my MySQL database i knocked togeather.
CREATE TABLE php_downloads (
title text NOT NULL,
desc text NOT NULL,
dlink text NOT NULL,
fsize text NOT NULL
) TYPE=MyISAM;
and here is the config.php page that is included in the code above...
<?php
$db_host = "localhost";
$db_user = "xxxxxxxxxxxx"; <-- My USER
$db_pass = "xxxxxxxxxxxx"; <-- My PASSWORD
$db_name = "xxxxxxxxxxxx"; <-- MY DATABASE NAME
?>