I have a SQL table like this:
$sql="CREATE TABLE
config (ID INT AUTO_INCREMENT PRIMARY KEY,
nombre VARCHAR(50),
valor VARCHAR(50));";
Lets think it have this lines (ID,name,value) :
1 | name1 | value1
2 | name2 | value2
3 | name3 | value3
How i can convert the result of my SQL query into a JSON object which only contains name a value data?