Array picking up key instead of item

I would appreciate any help:

edit column:


"shoot_location" =>array(
"default"=>"" ),

foreign key:



The result is a location field with “4” …

Two questions… As I’m having a brainf**t, I need to know what I’m doing wrong…

Second, is there a better way to have lookup tables that is more flexible to growth. Right now, I can add items to existing tables, (with the caveat that my results are screwy), but the user cannot add new tables without my intervention.

All help will be tolerated, moaned about, and implemented.


What is this code you’ve shared? It looks like part of an interior array of a multidimensional array… what is this array? What is the meaning of its content? How does that relate to your thread title? What are you asking for help doing?

Sorry, I’m not clear, it’s been a long weekend. I did not want to post all of the code - it’s huge.

I will if it will help.

I have a table of photograph information. This is for photographers who do not use digital cameras and need technical and business records of their work.

I have subordinate lookup tables for things like, the camera used, the lens used, developer, length of shot, location and country, etc.

I have had this working with built in arrays like this:

$fill_from_array_lens = array(

$fill_from_array_location = array(

$fill_from_array_country = array(
"United States"=>"United States",
"United Kingdom"=>"United Kingdom",

//$fill_from_array_film = array(
//"Kodak TriX"=>"Kodak TriX",

$fill_from_array_exp = array(

$fill_from_array_filmspeed = array(

$fill_from_array_filmISO = array(

This method offers no flexibility, as any change to a table has to be made by me.

Soo, I am starting to build an external array that can be managed by the user.

You can see the current status here:

The u/p is beatrice/Skopelos2009

It’s test data, and I have backups…

As a primary goal, I need to know what I’m doing wrong, in that the key rather than the value, is being passed back.

As an even more primary goal, I’d really appreciate learning if there is a better approach to this. I have a lot to learn.

There’s not really anything that people can help with from just a bunch of arrays - you need to show the code that you’re using to access/interact with the arrays.

At a guess, are you using the array_keys() function at all?

Thanks. I found the problem about an hour ago. I knew I was just pointing to the wrong place -the key rather than the content…

I just couldn’t see beyond that.

Sometimes, especially when you’re an indie, these forum help me to refocus and organize my thinking…

… and sometimes, they provide the answers too…