Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7511809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:40:15+00:00 2026-05-29T23:40:15+00:00

i have a problem with php in arrays. i have a db table like

  • 0

i have a problem with php in arrays.

i have a db table like that , it shows applications to job.
enter image description here

What i want is to order job titles with their files for example

title must be shown :

WEB Tasarım Uzmanı
noktamedya.com/CVs/zsdfsdfsdfsdfsdf.docx
noktamedya.com/CVs/zsdfsdfsdfsdfsdf.docx

İçerik Yöneticisi
noktamedya.com/CVs/abc.docx
noktamedya.com/CVs/abc.docx

i have a class which takes to important record from db

 public function getAllRec()
         {
             $query = "SELECT * FROM applyRecords ";
             $resultDb = $this->db->query ($query);
             $jobs = array ();

        while ( $row = $resultDb->fetchObject () ) {
            $job = new Job ();
            $job->title = $row->jobTitle;
                        $job->url = $row->file;

            $jobs [] = $job;
        }
        return $jobs;
         }

i have here to file and jobTitle.
in admin inc. i call this function like that

$jobs3 = $jobHome->getAllRec();

and try to order with their jobTitle but have error and dont understand

foreach($jobs3 as $job)
{
    $groupJobs = [$job->title][$job->url] = $job;
}

what’s wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T23:40:17+00:00Added an answer on May 29, 2026 at 11:40 pm

    I think this is what you are trying to do:
    Group job applications by title of job applying to

    $groupJobs = array();
    foreach($job3 as $job){
       if(!isset($groupJobs[$job->title])){
           $groupJobs[$job->title] = array();
       }
       $groupJobs[$job->title][] = $job; // add job to group
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I realized that I can have problems with single quotes in php arrays: <?php
I have problem with session in cakephp.I have one file chat.php that is in
I have the problem, that PHP replaces all spaces with underscores in POST and
I have a problem with sorting items in table in PHP. Here is what
The Situation I have a table in a DB that contains job types, basically
I have a problem with arrays in PHP. So, lets see: I have a
I have some code that grabs some rows from a table and I want
I have http://communitychessclub.com/games-nu.php with a game scores table. And I want the user to
Level: PHP Learner I'm stuck with a checkbox problem. I have a db that
I have a problem in php code inserting values into database (I use PHPMyAdmin).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.