Ok so I'm getting into PHP and I have a decent sized MySQL/PHP database system working fine but I'm having problems with the foreach command...
When I get the info from a MySQL database I usually use the following command to assign a variable to each value:
foreach ($row as $key => $value) {$$key = $value;}
This works perfectly but I was wondering is there a way to check something like $datestamp vs $new_datestamp and $timestamp vs $new_timestamp by doing something like this code below?
foreach ($row as $key => $value) {
$$key = $value;
if ($new_$$key==$$key){echo "$new_$$key is same as old $$key, which is $value\n";
}
I know this doesn't work above but I'm presuming it's something to do with my syntax... I've had a look at PHP.net tutorials and done a bit of googling but I'm lost on this simplest of all problems...
I could do it the long way with like 20 conditions but I want to get more efficient in my programming.