hey i guys i want help from you.
i am working on website project, in that i want to create “if user upload some data then it will be stored in his folder” for this i want currently login username.Because the folder name=username.
when user register to my website it will create folder in webspace which name=username.
now i want to take currently login username for defining path to uploaded image.
i give you example:
if (isset($_SESSION['username']))
{
$username=($_SESSION['username']);
$CHECK=mysql_query("Select `status` from `user_reg` where `username`=$username");
if ($check="Admin") {
$userimage="/Place4Info/Data/Admin_data/".$username."/";
} else {
$userimage="/Place4Info/Data/User_data/".$username."/";
}
i save path in $userimage & then use it everywhere.
above code is not running
First, $CHECK is not the same as $check. Second, $CHECK is a mysql resource, not a string containing a value from the database. Third, you can print mysql_error() after mysql_query() to determine wheter the query failed and why.
Something like: