I have already got a fully functional membership site and I wanted to add in a query to see if the user has changed the password from the default (Use amember pro as well and link across domains so must be seperate).
I tried the following to just echo the users username and it worked:
(Each user has their own seperate database so I only need so search where id=1).
This displays the default username.
So I want to query this username so I change this code to:
Now the page wont load at all. At the very end of the page I have included <?php } ?>
Really what I would like to do is query the MySQL result so if $USER="someusername" rather than NULL.
Anyone know if this is possible or how to fix my code?
I tried the following to just echo the users username and it worked:
PHP Code:
<?php
$result=mysql_query("SELECT `username` FROM `members` WHERE `id`=1");
while ($row = mysql_fetch_array($result)) {
$USER = $row["username"];
echo $USER;
?>
This displays the default username.
So I want to query this username so I change this code to:
PHP Code:
<?php
$result=mysql_query("SELECT `username` FROM `members` WHERE `id`=1");
while ($row = mysql_fetch_array($result)) {
$USER = $row["username"];
if $USER==null{
echo "Please Change Your Username";
}else{
?>
Really what I would like to do is query the MySQL result so if $USER="someusername" rather than NULL.
Anyone know if this is possible or how to fix my code?

Comment