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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:13:09+00:00 2026-06-04T13:13:09+00:00

I am newbie in CodeIgniter . I created a method that insert record in

  • 0

I am newbie in CodeIgniter. I created a method that insert record in mysql db table now to make the query stop if record with same name already exists so I wrote:

public function set_project()
    {
        // If project name already exists?
        $query = $this->db->query("SELECT pro_id FROM projects WHERE pro_name = '".$this->input->post('pro_name')."'");

        if ( sizeof($query->row_array()) == 0) {

            $data = array(
                'is_featured' => $this->input->post('is_featured'),
                'pro_type' => $this->input->post('pro_type'),
                'pro_name' => $this->input->post('pro_name'),
                'pro_client' => $this->input->post('pro_client'),
                'pro_loc_city' => $this->input->post('pro_loc_city'),
                'pro_loc_state' => $this->input->post('pro_loc_state'),
                'pro_yr_start' => $this->input->post('pro_yr_start'),
                'pro_yr_end' => $this->input->post('pro_yr_end'),
                'pro_loc_cur' => $this->input->post('pro_loc_cur'),
                'pro_size' => $this->input->post('pro_size'),
                'pro_size_cat' => $this->input->post('pro_size_cat'),
                'pro_size_units' => $this->input->post('pro_size_units'),
                'pro_desc' => $this->input->post('pro_desc')
            );

            return $this->db->insert('projects', $data);

        } else {
            return "Already exists";
        }

which works fine but who can I show message to my view?

  • 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-06-04T13:13:11+00:00Added an answer on June 4, 2026 at 1:13 pm

    Okay I did it, actually I have to move that check in controller.

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

Sidebar

Related Questions

Im newbie here.I have a problem with codeigniter segment() method.I referred 6th segment of
Newbie question: I just installed VisualSVN Server and created a repository. I noticed that
(Newbie DBUnit question Alert!) It appears that DBUnit for each table 'deletes all the
Newbie question about PostgreSQL. I'm migrating a MySQL/PHP app I've created, hosted on a
Newbie here. I'm using codeigniter and mysql How can I dynamically (number of names
Newbie SQL question here --> I've got an Occurrences table that contains a row
Newbie question. I have Django models that look like this: class Video(models.Model): uploaded_by =
I am a newbie in codeigniter. I am using an an login form to
I am a newbie in CodeIgniter. And would like to know how am I
I am newbie. I have Windows XP and use the CodeIgniter framework. I wanted

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.