[FONT="Arial Black"]Notice: Use of undefined constant name - assumed 'name' in C:\Program Files\EasyPHP-5.3.8.1\www\myscripts\databaseConnection.php on line 23
cosmo[/FONT]
Here 'cosmo' is entry in database. Means I m getting the result 'cosmo' which I want, but with error message.
Above error is genrated from following PHP code snipet.
<?php
echo "Connecting to the database...";
$con = mysql_connect("127.0.0.1:3306", "root", "");
if(!$con)
{
die('Could not connect: '.mysql_error());
}
else
{
echo "<br><strong>Connected to database successfully</strong><br>";
mysql_select_db("login", $con);
$result = mysql_query("SELECT * FROM users");
while($row = mysql_fetch_array($result))
{
echo $row[name];
echo "<br>";
}
}
mysql_close($con);
?>
Here 'name' in the statement, echo $row[name]; is column name of the table 'users'
Please help me with this.