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?
Character increment
Hi,I am facing a scenario like above,but in my case i want to show up like Col A,Col B etc....The container where i am displaying this is being dynamically generated using jquery.Any help?
Pipe email to PHP - get mail adress from MySQL - send?
Hi all,this is the challenge:1) Our faculty at the college where I'm employed includes quite a bit of freelancers that don't check the college mailbox quite as often as the administration would
Array disappearing in foreach loop
Okay, I have this problem where an array will become undefined in a foreach loop.Here is the function plus a couple comments:Code: [Select]function mineResources($nation) {global $db;$resources =
images aren't rendering
I'm trying to call a JPG file from within PHP (in an effort to hide the actual JPG folder). The image is supposed to be called at domain.com/photo/?id=X&i=Y where X is the gallery ID and Y is
Why is my row count 0?
Here's the MySQL query i'm running. It basically pulls data from 2 tables based on some data passed.Here are things i know.1. The data passed is passed correctly, and is correct as far as data goes.2.
unexpected T_VARIABLE error
Hey all! I'm getting an unexpected T_VARIABLE with the following function:function getHighestParentName($id = $this->cid){ $cat = mysql_fetch_assoc(fsquery('getParentCategories', $id));
SHOW TABLES Help
Hi allI have the followingCode: [Select]<?php$sql = "SHOW TABLES";$result = mysql_query($sql);while ($row = mysql_fetch_row($result)) { echo "Table:
Generate PDF
Hi guys,I would like to know if there is a way to generate pdf when clicking on a link. In fact, I would like to be able to click on a link and generate a pdf file with information from my database,
remove a ; from emails in textarea
Code: <?php session_start(); $database_host = "localhost"; $database_username = ""; $database_password = ""; $database_name =
TabControl Inside ListView Not Editing
Hello everybodyI have a ListView on my page. Inside the ListView I put a TabControl, cuz I want to put different input controls on seperate pages. The problem is that changes made by the user in the