I've created a database and when I try to write a query, I'm getting the Die phrase. The script isn't returning an error when it connects to the database. When I run the query in Sequel Pro, it is returning the correct information. Any ideas?
Here's the code:
<?php
echo "<p>everything is beautiful</p>";
echo "Gigem aggies";
$host="127.0.0.1";
$user="root";
$password="";
$Dbname = "Digital Rails";
$cxn = mysql_connect($host,$user,$password,$dbname)
or die ("couldn’t connect to server");
mysql_select_db("Rails", $cxn);
echo "<p>" . $_POST["Display_Entry"] . "</p>";
$posted = $_POST["Display_Entry"];
echo $posted;
$query = "SELECT * FROM Rails WHERE Display=$posted";
$result = mysql_query($query)
or die ("<p>Couldn’t execute query.</p>") . mysql_error();
$counter=1;
while($row = mysql_fetch_array($result));
{
echo $row['Eia'] . " " . $row['Freq'] . " " . $row['Station'];
echo "<br />";
}
;
?>