PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to show the IP of, and time since, previous logins in a table. The problem i am having is the first time someone logs in, i dont wish for the second and third row to be shown (as they are empty). I thought the above code might work, but it is not - it's not interpreting the variables (i hope that's the correct word).
First, is it possible to actually do what i am trying by this method - and if so how. If it is not possible could someone suggest an altenative method please.
volka wrote:Why do you extract the values from an array only to bulid an array from that values?
Variable substitution does not take place in single-quote string literals, see http://de2.php.net/string
All the information is stored within the same row of the table. The new array that is built is a different to the first. I need to build a new key and value - maybe you have a better idea that i could use?
Thank you. Your ideas have improved what i have it - the third key/element (ie. $ip3 and $time3) displays correctly, but not the other two. Any ideas?
Anyways. I have a question. Why did you initialise $i = 1 and not $i = 0? It works, so I'm not saying what you did is wrong, i just thought that '0' is always the first element in an array.