hatte ich Abfrage für Daten in dieser SQL:Wie ändert man den Wert in Array-Objekten?
//query by location total post
$sql = 'SELECT ljj.job_id, count(ljj.job_id) as count, ljj.job_type FROM {local_jobs_job} ljj INNER JOIN {local_jobs_location} ljl ON ljj.job_location = ljl.location_id GROUP BY ljj.job_type';
//get the query into record
$data = $DB->get_records_sql($sql);
Der Ausgang ist hier:
[job_type] => 0 to [job_type] => 'Job'
[job_type] => 1 to [job_type] => 'Internship'
Ich weiß nicht, wie:
Array ([1] => stdClass Object ([job_id] => 1 [count] => 8 [job_type] => 0) [3] => stdClass Object ([job_id] => 3 [count] => 7 [job_type] => 1))
ich den Wert ändern müssen um zu dem Wert zu kommen, wie es ein Objekt-Array ist.
Wie bekomme ich den Wert und ersetze es?
Sie finden hier eine Lösung https://stackoverflow.com/questions/5875785/how-to-access-stdclass-object-after-a-specific-key-value-pair –
Können Sie ein Beispiel geben für meine Frage? Ich lese Ihre Referenz, habe aber immer noch Probleme. Ich bin nicht sehr gut in Multi-Arrays. Danke, wenn du helfen kannst. – joun
Sorry über die Zeit Ich war weg einige Minuten Beispiel hier;), Grüße. –