close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

needs some help please

Thread began 5/18/2012 2:07 pm by akstudio | Last modified 5/21/2012 2:31 pm by akstudio | 2040 views | 8 replies

akstudio

needs some help please

Im going nuts here. Here is the basic flow of data:

admin logs into backend. fills out a form. This form has a file upload and 4 check boxes. each checkbox is equal to a user level. This allows me to display the file based on user level. Some files may be seen by more than one user level.

my table is as:

table name: policies

id
file_name
1
2
3
4

each number represents a user level

when a file is uploaded and tagged as 3 for example, the data in the "3" field is either 1 or 0.

Now, what I want to do is to display all file_names in 3, that are 1.

Makes sense?

To make matters more complicated, I think I need to define it by '$_SESSION[user_level]'.

I have no idea who to do this. I have tried a ton of things. The closest I have come to is:

$SQL = "SELECT * FROM policies ";
if($_SESSION['user_level']== 1)
{
$SQL = $SQL . "WHERE 1='1'";
}
if($_SESSION['user_level']== 2)
{
$SQL = $SQL . "WHERE 2='1'";
}
if($_SESSION['user_level']== 3)
{
$SQL = $SQL . "WHERE 3='1'";
}
if($_SESSION['user_level']== 4)
{
$SQL = $SQL . "WHERE 4='1'";
}

echo $SQL;

But I still only get one file back, and its usually the first record in the table, doesnt matter if its 1 or 0

This is way out of my league now.. is there an easy way to just : select all "1's" from my table, based on you is logged in?

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...