Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.
Mysql Row data php
Heya guys, Im trying to make a points system for my site .. All i need now .. is to echo them :P Sounds simple yea .. But i cant seem to get the sql bit right .. Ive tried loooads of different things …. But this is my most recent attempt
<?php
function dbarray($query) {
$result = @mysql_fetch_assoc($query);
if (!$result) {
echo mysql_error();
return false;
} else {
return $result;
}
}
function dbrows($query) {
$result = @mysql_num_rows($query);
return $result;
}
$un = $_SESSION['session_user'];
mysql_connect("localhost", "root", "***********") or die(mysql_error());
mysql_select_db("cms") or die(mysql_error());
$query = "SELECT * FROM users WHERE username=$un";
$result = mysql_query($query);
if (dbrows($result)) { $data = dbarray($result); }
$req_points = $data->points;
echo "req_points";
?>```