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?
MySQL Does not UPDATE- SQLString Problem
vb Syntax (Toggle Plain Text)
j1inmis Ouput layout changes
Hi,
Need Successful Return
Hello I am currently working a form here, and I have everything figured out except when I click the return button from my preview view. the information is lost in all the textarea's. Any clue what I
How to refresh a parent page from a modal popup
Hi,I have a modal popup in which I need to upload a file and store in the database should give a message to the user that file is uploaded and update the parent page when I close the
Mail sending is slow on server
Why mail is taking time to be send on apache-linux server
Regular expression tips or resources
Hello! I'm having some issues implementing the appropriate regex patter to eliminate unwanted characters from a string.Here is a sample string: Code: String str = "test-hello. me please3, _dog[
Sum of Values in an Array
This is probably really simple... but it's been years since I've written anything, so bare with me!I've got a MySQL database setup with a table that has multiple fields, where one is a numerical
Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there is a way to track uploading with APC and php 5.2 + ?? any suggestions thanks
Function to extract email attachments using PHP IMAP
function extract_attachments($connection, $message_number) { $attachments = array(); $structure = imap_fetchstructure($connection, $message_number); if(isset($structure->parts)
php unable to sent email
Hi, guys, I try to send a email through php but unfortunately the mail unable to sent. Here is my code, any configuration that I need to change in order to send the email ? Anyone who know please help