好的,所以我今天工作太久了,我被困在一些简单的事情上(我想)
function commonData($uid)
{
if ($uid)
{
$sql = "
SELECT a.user_id, a.email, a.username, a.displayname, a.level_id, a.photo_id
FROM engine4_users AS a
WHERE a.user_id = ".$uid;
}
$UserInfo = @mysql_fetch_assoc(mysql_query($sql));
if ($UserInfo[user_id])
{
if ($UserInfo[photo_id] && $UserInfo[photo_id]!="NULL")
{
$PPhoto = @mysql_fetch_assoc(mysql_query("SELECT a.* FROM engine4_storage_files AS a WHERE a.file_id = ".$UserInfo[photo_id]));
$photo = SITE.$PPhoto[storage_path];
}
else $photo = NO_PHOTO;
$queryMoreProfile = mysql_query("SELECT * FROM engine4_user_fields_values AS a WHERE a.item_id = ".$UserInfo[user_id]);
while ($moreProfile = @mysql_fetch_assoc($queryMoreProfile))
{
//$location = '';
if ($moreProfile['field_id']==24)
{
$locationNumber = $moreProfile['value'];
$locationsql = @mysql_fetch_assoc(mysql_query("SELECT a.* FROM engine4_user_fields_options AS a WHERE a.option_id = ".$locationNumber));
if (isset($locationsql['label']) && !empty($locationsql['label']))
{
$location = $locationsql['label'];
}
}
//if(empty($location))
//{
// header("Location: http://www.fetishmen.net/members/edit/profile");
// exit;
//}
}
我想做的是说,如果$location
没有价值(完全从数据库中丢失)重定向到一个页面。我在这里做错了什么?