Skip to content
Advertisement

How can i echo out the helper_tbl status column seperately and the getter_tbl status column field too

I want to be able to specify the table column am echoing .

Am getting blank when i try to print out just from the helper column

Advertisement

Answer

Your problem is that both columns are called status, so when the result array is formed the second status value overwrites the first (since a PHP array can only have one value for a given associative key). You can work around that using column aliases:

Note you will have the same issue with your user_id column (and possibly others). Generally it is better practice to enumerate the columns you want individually (rather than using *) so that you can avoid this problem from the beginning.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement