""Terion Miller"" <[email protected]> wrote in message
news:[email protected]...
>> > $result=mysql_query($query) or die('Queryproblem: ' . mysql_error()
>> > .
>> > '<br />Executed query: ' . $query);
>> > if (mysql_num_rows($result) >= '1'){
>> > while ($row = mysql_fetch_assoc($result)){
>> > echo $row['AddEditAdmin']; //to print out the value of
>> > column
>> > 'var1' for each record
>> > }
>> > }else{
>> > echo 'No records found.';
>> > }
>> > ?>
>> >
>> > anyone have ideas for me, the session user is working, and I need to
>> > use
>> > it
>> > in the query to pull only that users data I also on the login page
>> > where
>> I
>> > set that session all set it to = $UserName but when I try and use that
>> > in
>> > the query UserName = $UserName I get an undefined variable error...
>> >
>> > Really trying but not quite getting it...
>> >
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>> Well I am def. further along, the query is working, I can echo fields in
> the $row and get the results but when I try and use this:
>
> <?php
> if ($row['AddEditAdmin'] == 'YES') {
> ?>
> to sort out what menu items to load it just doesn't do its job.
>
I would say do this to see if what is in the return is what you are
expecting
foreach($row as $key=>$value){
echo $key , ': ' , $value , '<br>';
};
just to make sure that the value is "yes", and not 1 or true or something
like that.
Frank
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php