I'm trying to write some code that will retrieve a user's access level from my database and if it doesn't return any values then I want to set the access variable to 2.
I'm using...
$access_id = $useraccess["0"]["access_id"];
if (!$access_id) {$access_id = '2';}
Where $useraccess is the array I've got from the database. I set the variable $access_id to whatever the user's access_id field contains. Then I check the variable because if the access_id field is empty then I know the user hasn't had one specified and should be given the site default. The problem is one of the access levels is '0' which is returning an empty value and then setting it to two.
Has anyone any idea how to stop this please?
FTP Programs
Here is a list of commonly suggested FTP Programs to use:FileZillaSmartFTPCuteFTPRightFTPCoreFTPJFTPFireFTP
Dynamic links in an include file
I am working on a small piece of code that counts records from a database and displays the result to the user. Everything works fine, except I am running into difficulties with dynamic links.The code
UTL File problem
Hi
Displaying pictures
i have worked my way through storing images in directory and storing the location in mySQL db.Now i was trying to make a Image gallery for just that particular user who had uploaded those images. i am
Help with explandable category tree
I have the below query: SELECT l1.id as lev1_id,l2.id as lev2_id,l3.id as lev3_id,l1.category AS lev1, l2.category as lev2, l3.category as lev3 FROM categories AS l1LEFT JOIN categories AS l2 ON
for some reason mysql query not working, not inserting, please check it out
This code is not inserting anything into my db, don't know why, the $_SESSION variable does contain data.Please have a look.Code: function add_user_to_db() {
Specific name typed, specific image shown on html page
Hello,Fairly new to PHP and was curious if someone might know how to solve a fairly simple request.I am currently passing the name of an end user (who types their name in a form field) to a URL which
Weird MySQL error, why am I recieving this?
PHP Code:<?php require "global_settings.php"; ?><title><?php echo $sitetitle; ?></title><center><style
PHP page is blank
Hi Everyone,I have a site in which I am able to open the first PHP webpage in my browser but when I start navigating the site, another webpage doesn't open. The page is totally blank for this webpage.
How to write on database when a link is clicked?
Hi,