trying to query the db and echo the val, of the row, but it's echoing the var instead...
Code: Select all
$ranks = "SELECT `rank` FROM `users` WHERE `username` = '{$name}'";
@mysql_query($ranks) or die(mysql_error());
echo "blah".$ranks."blah";Moderator: General Moderators
Code: Select all
$ranks = "SELECT `rank` FROM `users` WHERE `username` = '{$name}'";
@mysql_query($ranks) or die(mysql_error());
echo "blah".$ranks."blah";Code: Select all
$result = @mysql_query($ranks) or die(mysql_error());
$row = mysql_fetch_assoc($result);
print_r($row);Code: Select all
$ranks = "SELECT `rank` FROM `users` WHERE `username` = '{$name}'";
$result = @mysql_query($ranks) or die(mysql_error());
$row = mysql_fetch_assoc($result);
echo ".$row.";Code: Select all
<?php
$ranks = "SELECT `rank` FROM `users` WHERE `username` = '{$name}'";
$result = @mysql_query($ranks) or die(mysql_error());
$row = mysql_fetch_assoc($result);
echo $row["user"];
?>Code: Select all
SELECT * FROM `users` WHERE `username` = '{$uname}'you can only display the col. values you selected .... so change<?php
$ranks = "SELECT `rank` FROM `users` WHERE `username` = '{$name}'";
$result = @mysql_query($ranks) or die(mysql_error());
$row = mysql_fetch_assoc($result);
echo $row["user"];
?>
Code: Select all
echo $row["user"];Code: Select all
echo $row["rank"];