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?
problem when runing a funciton
I am trying to connect to database using a funciton in a functions.php <?phpfunction connect_db_Blog (){ $con=mysql_connect("localhost","root","");
Strange Oracle Query problem
Ok So I have this PHP class that talks to a Javascript class that basically creates a table of information from a database query and puts it in a sortable, filterable table. This all works fine and
mysq_num_rows
Hi,I want to use:Code: if(mysql_num_rows($ergebnis2)==2)how can the value 2, be retrieved from the database?example, lets say I have ifCode: (mysql_num_rows($ergebnis2)==$limit)$limit =
Odd or Even
Inside of a while loop I need to echo several rows of info...easy enough.In the loop (for the sake off css) I need to distinguish between odd and even row numbers.Code:
PHP and SMS
Hi all forum members. I am new here and am unsure what category shoild I post this in. Moderators: Please excuse me if this is in the wrong category.The problem is that I am assigned with the task of
Script not running properly
Hello EveryoneThis is a basic script for posting to a database. I'm not sure why it doesn't work. Can anyone tell me why?Code: [Select]<?phprequire('config.php');if(isset($_GET['id']) == TRUE
onClick='location.href=index.htm'> not working
Below is my code:echo "<input type='button' value='redirect' onClick='location.href=index.htm'>";what is wrong with the code?? it's not working
How can I Compare two xml documents?
Hi all,
PHP Code / Script To check weather the given email exists in a domain
Hi,I want to implement the following in my web pagein sign up we will ask to enter user existing email id , so now i need to check weather the entered email currently available are not without sending
restricting another login once you logout
Hello,how can I restrict a page from login authenticating against info in a MySQL DB for a second time? Right now a login check against username and password in a MySQL table and allows access against