I'm trying to get data out of a mysql db and I have the login info saved in another file. The username is getting sent from my form to the page with the code and i'm getting a
Parse error: syntax error, unexpected '[', expecting ',' or ';' in C:\xampp\htdocs\waladmin\ipfinder.php on line 31.
I don't understand why its saying that though, everything looks fine.
Here's my PHP:
<?php
testinclude('db_login.php');
$con = mysql_connect($db_host,$db_username,$db_password);
//$con = mysql_connect('10.241.10.40','waladmin','waladmin');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$db_select=mysql_select_db($db_database);
if(!db_select)
{
die("Could not select the database. <br />".mysql_error());
}
$select = ' Select ';
$column = ' IP_Address,Workstation,Username ';
$from = ' FROM ';
$tables = ' admintable ';
$where = ' where Username = " & ControlChars.Quote & Username & Username & ControlChars.Quote & "ORDER BY admintable.Time_Stamp DESC';
$query = $select.$column.$from.$tables.$where;
$result = mysql_query($query);
if(!result)
{
die("Could not query the database: <br />".mysql_error());
}
while($result_row = mysql_fetch_row(($result))){
echo 'Username: ' . result_row[2] . ' <br /> ';
echo 'Workstation: ' . result_row[2] . ' <br /> ';
echo 'IP Address: ' . result_row[1] . ' <br /> ';
}
echo $con;
mysql_close($con)
echo $con;
?>