Jump to content

Search the Community

Showing results for tags 'is_array'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. The website I am working on is a HRIS project for a popular fast food franchise chain. The login for one restaurant allows one user to modify all actions for all restaurants owned by the same franchisee. These are organized by multiple databases calling the same id's. Below is the code used for selecting all restaurants where the same franchise id is used as the restaurant login. $result = mysql_query("SELECT id, name FROM restaurants WHERE franchise = $_SESSION[sESS_RESTAURANT_FRANCHISE]"); $_SESSION['franchise_arr'] = array(); while($row = mysql_fetch_array($result)){ $_SESSION['franchise_arr'][$row['id']] = $row['name']; } So lets say for one login the SESSION array is populated like this: $_SESSION[sESS_RESTAURANT_FRANCHISE][1] = "Restaurant One"; $_SESSION[sESS_RESTAURANT_FRANCHISE][15] = "Restaurant Two"; $_SESSION[sESS_RESTAURANT_FRANCHISE][29] = "Restaurant Three"; I need a way to check to see if the KEY value is in an array as oppose to the value itself. For example I have: if (!in_array($rest, $_SESSION['franchise_arr'])){ $rest = $_SESSION['SESS_RESTAURANT_ID']; } However that checks for the values "Restaurant One", "Restaurant Two", "Restaurant Three". Where I would like it to look for "1", "15", or "29". I hope someone understands what I mean :\ I've been strugging with this for quite a while.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.