PHP Hash Table

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rcua
Forum Newbie
Posts: 1
Joined: Wed Feb 11, 2009 12:54 am

PHP Hash Table

Post by rcua »

Hi,

I am trying to insert, update and display items that a user have collected. I heard that, using hash table would be more efficient, is it true? What is hash table? How to do it? I am using php5 and mysql. Any tutorial with simple code would be great.

Thanks. :D
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: PHP Hash Table

Post by susrisha »

hash table as such doesnt exist in php. Its got another name=>associative arrays. Have a look at the arrays manual http://in2.php.net/manual/en/book.array.php for more details.

Its basically like this. In an array you will have

Code: Select all

 
$array[1]='something';
$array[2]='somethingelse';
 
On an associative array you will have

Code: Select all

 
$phone_number['victor']=98272634;
$phone_number['sam']=5652332;
 
These are called key value pairs.. Thats a basic information.. More can be got on the link
Post Reply