Wonder if you had any thoughts on the original question - the problem : using a table.column in an associative array.
I tried putting it into $stringvariable but that did not work.
I can obviously give all columns unique names throughout the DB but I am sure I am missing something.
Sorry for all these dumb questions I have done no database work for over 35 years - how depressing.
Once I get everything working I will rip it apart and do a tidy version so any “best practice” tips (or I really mean easy to code/easy to maintain tips) would be more than welcome.
Because the PHP code uses a database.
Of course it may also have HTML and/or CSS and/or JavaScript but for whatever reason those forums don’t seem to have the same problems with this as the Database forum does.
Anyway, @shomer; Sorry, but I don’t see in your code where it is “using a table.column in an associative array”, please clarify.
I’m not sure if this is something that could be handled better with a better db design/query or if it is in fact something that needs to be done with PHP
LOL OK only asking and it is a mixed PHP/MySQL question and you gave me very helpful MySQL pointers
Oh and ColdFusion - I never got to grips with it and thought it had almost died (I thought only Adobe backed - anyway sorry that is a bit of an arcane conversation.
The problems was that in the original fetch() I was using (which I think is an associative array)
$messageinstanceid = $row['message_instance.id'];
but it would fail no matter how I tried to escape it. I thought if I put it into a string variable that might work but it did not.
So I have a problem because I have many columns called “id” and need to be able to differentiate them in a fetch like this.
This time I got lucky as the variable in question was the index for the whole select statement so I could go back and grab the $_POST variable but it won’t always be like this.
I can go through all my tables and change all ambiguous columns (might not be bad idea but, particularly on this first build don’t want to do too much revision.
One thing I am pretty sure I can do is split queries into simpler queries but I am sure there must be away around this.
SELECT [COLOR="#FF0000"]foo.id AS foo_id[/COLOR]
, foo.frick
, [COLOR="#FF0000"][/COLOR][COLOR="#FF0000"]bar.id AS bar_id[/COLOR]
, bar.frack
FROM foo
INNER
JOIN bar ...
Dear @983 ; I seriously cannot thank you enough. I had JUST hit this again where I was not going to be able to substitute a $_POST variable in a loop and thought I was stumped and checked on here and that worked PERFECTLY!
There does not appear a Kudos or Thanks button on here. Pity.
Mods a small micro payment system would also be nice. Would love to buy @983 ; a beer or the Bitcoin equivalent.
Oh my goodness sorry. Keep posting when I am exhausted. Sorry for getting your name wrong @r937 ; (BTW is that a clever reference to something I am not getting - like an Eliot 803 or whatever?)