Is it possible to output SQL query result in one string or variable? (i'm bad in php and mysql) Let's say I have db "agents" with columns - agent_id, agent_fname, agent_lname, agent_dept.
Using this query:
$sql = SELECT a.`agent_fname` FROM agents a WHERE a.`agent_dept` = 'FCA'
I want to get a string or a variable, so I can use it in any place of my php file (i.e. $my_variable which outputs the result of my query). Is it possible? If yes - how?
Thank you!
*I have more than one row.