$result=mysql_query("SELECT * FROM users where id=1");
print_r($result);
Here is the result data from mysql query.
Array
(
[0] => stdClass Object
(
[firstname] => "John"
[middleinitial] => "A."
[lastname] => "Doe"
)
)
I want to add address: "USA" after the lastname that will result like this:
Array
(
[0] => stdClass Object
(
[firstname] => "John"
[middleinitial] => "A."
[lastname] => "Doe"
[address] => "USA"
)
)
How can I append that to $result variable in php? Help would much appreciated. Tnx :)
SELECT *,'USA' as address FROM users where id=1Then it will be in the array without needing to add it