Friday 15 July 2011

PHP Arrays - Help storing and sorting multiple columns -


I am working on a search system for my database where I break the search term in different search terms. My mysql database outputs a list of the keyword table for any of those words, and then the ID associated with the keyword.

I want to add those IDs to a new array in which the name of the place related to a count value and (new query) ID, resulting in:

array (id, calculation, Name)

For every search term I want to go through this process and if the ID is already above, I want to increase the count value and if not, then I I want to associate with value value.

When the array is formed and all is counted, I want to count it and then sort it by name, and then output the result.

I have programmed PHP for a while, but I was never good enough to create and manipulate arrays so that any help related to 3-column creation, searching, editing And the sorting array is appreciated

Here are some code below, where I am just trying to insert data into the array and spit it, which clearly does not work:

  & lt; Php $ id = 5; $ Count = 1; $ Name = "place name 1"; $ ArrayPlaces = array ($ id, $ count, $ name); Echo "5:" $ array location [5] "
"; ? & Gt;

  & lt ;? Php $ id = 5; $ Count = 1; $ Name = "place name 1"; $ ArrayPlaces = array ($ id = & gt; array ('count' = & gt; $ count, 'name' = & gt; $ name); Echo "5:" $ Arrange Place [5] ['name'] "
"; ? & Gt;

No comments:

Post a Comment