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 6323593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:32:53+00:00 2026-05-24T16:32:53+00:00

I have job insert page which is working fine. I just build an update

  • 0

I have job insert page which is working fine.
I just build an update page in admin panel.
I’m not able to show screen short 🙁

I need to show the category as selected which is already in the job table.

let me show you the table details.This is the job table

    CREATE TABLE IF NOT EXISTS `jobs` (
  `job_id` int(11) NOT NULL AUTO_INCREMENT,
  `job_title` varchar(99) NOT NULL,
  `job_category` int(3) NOT NULL,
  `job_location` varchar(33) NOT NULL,
  `job_country` varchar(33) NOT NULL,
  `job_salary` int(12) NOT NULL,
  `job_reference` varchar(9) NOT NULL,
  `job_contact_name` varchar(9) NOT NULL,
  `job_description` text NOT NULL,
  `job_requirments` text NOT NULL,
  `job_companydetails` text NOT NULL,
  `status` int(2) NOT NULL,
  `date` date NOT NULL,
  `featured` int(1) NOT NULL,
  PRIMARY KEY (`job_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1091 ;

and this is the category table

CREATE TABLE IF NOT EXISTS `job_category` (
  `category_id` int(11) NOT NULL AUTO_INCREMENT,
  `category_name` varchar(25) NOT NULL,
  PRIMARY KEY (`category_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;

I’m just showing data from job table for update.
but the thing is that I need to show JOB CATEGORY in the Combobox.
I think it is easy through like this

<select name="job_category">
<?php
$result = mysql_query("SELECT * FROM $category_tbl");
while($row = mysql_fetch_array($result))
{       
echo "<option value=$row[category_id]> $row[category_name] </option>";
}
?>
</select>

but the thing is that I need to show selected category name which is in the job table

  • 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-24T16:32:53+00:00Added an answer on May 24, 2026 at 4:32 pm

    In the while loop you can have something like:

     while($row = mysql_fetch_array($result)) { 
          echo "<option value='$row[category_id]'";
          if($row['category_id'] === $rows['job_category']){
               echo "selected='selected'";
          }
          echo "> $row[category_name] </option>";
     } 
    

    job['job_category'] would contain the category id of the job you are currently displaying.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a lot of SQL insert/update/delete statements of which some are redundant. For
I have batch job which reads data from bulk files, process it and insert
I have just moved job and gone from VB 6 to VB.Net and found
I have a online Slide Show I'm working on using jQuery. I have use
I have an app in C# when part of its job is to insert
I have an INSERT trigger on a table that simply executes a job. Example:
I have a site which displays job vacancies. The data is provided as an
I have a job interview tomorrow for a .NET shop. For the past few
We have a job management application running (Access) with the database in SQL Server
I have a job on SQL Server 2005 running a ssis package. The package

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.