0
I need the following result within a variable from a query PHP + Mysql:
array(1) {
[0] => object(stdClass) #1 (3) {
["id"]= > string(2) "1"
["nome"] => string(5) "teste"
["email"] => string(18) "[email protected]"
}
}
The above result is obtained like this:
$results = array((object) array(
'id' => '1',
'nome' => 'teste',
'email' => '[email protected]'
));
UPDATE: If I have 1 or more ID’s, that is, 1 or more names and emails
array(2) {
[0]=>
object(stdClass)#2195 (3) {
["id"]=>
string(2) "1"
["nome"]=>
string(16) "testao"
["email"]=>
string(14) "[email protected]"
}
[1]=>
object(stdClass)#2196 (3) {
["id"]=>
string(2) "2"
["nome"]=>
string(17) "testado"
["sml_email"]=>
string(18) "[email protected]"
}
}
Places the code of your query and how far you have gone in trying to do the array.
– Ricardo
I don’t know how you create this query with Object, that’s the question. Can you help with any example query? The array I created manually.
– Lollipop