it seems i can't output my username value from my database. All it gives was also a value of "username". So if i'm echoing my variable $users which is holding the rows of my username from my database, it strangely outputs "Welcome, username". I tried also with my password but also giving the same text. I can't figure out what's my problem here... Hmmm
<?php
$error = 'Could not connect';
$mysql_host = 'localhost';
$mysql_user = 'root';
$mysql_pass = '';
$mysql_db ='test';
@mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die($error);
@mysql_select_db($mysql_db) or die($error);
$query = "SELECT 'username', 'password', 'firstname' FROM users";
if ($query_run = mysql_query($query)){
while($row = mysql_fetch_assoc($query_run)){
$users = $row['username'];
echo 'Welcome, '.$users;
}
}
else
{
echo mysql_error();
}
?>