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

The Archive Base Latest Questions

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

I am working on a bug(?) for a few hours now, but couln’t fix

  • 0

I am working on a bug(?) for a few hours now, but couln’t fix it.

This is my code:

 if(!$this->db->get_where('merken',array('m_merken' => $brand))->count_all_results()){

      $insetData = array('m_name' => $brand);
      $this->db->insert('merken', $insetData);

 }

$brand contains ‘Acer’ in this preview.

 A Database Error Occurred

    Error Number: 1054

    Unknown column ‘Acer’ in ‘where clause’

    SELECT * FROM (`merken`) WHERE `m_name` = Acer 

I want to check if it already exists, but it won’t work very well.

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

    Without quotes, your statement:

    SELECT * FROM (`merken`) WHERE `m_name` = Acer
    

    Acer refers to a column-name. If your intent is a string literal, put it in single-quotes, as in:

    SELECT * FROM (`merken`) WHERE `m_name` = 'Acer'
    

    Also, as a matter of good programming practice, avoid SELECT *, better to SELECT each column you want to return, even if the list is lengthy.

    — EDIT —

    I suspect I’m missing the point… the SQL is generated. Two things to check:

    Is m_name correctly declared as a string/varchar/char field?
    Failing that, try literally setting the brand name to 'Acer', with the quote marks. I doubt this is a reasonable solution, though.

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

Sidebar

Related Questions

I have been working on this frustrating bug for a few days now and
I've been working on my project for a few hours now, only to be
I'm working on a bug fix right now for an application at work where
I am working on a bug in this program where it should be able
I'm working on catching a seriously insidious bug that's happening in my code. The
I am working on this yahoo pipe Regex and I found a bug I'm
I have been struggling with these for a few hours now, and have come
Does anyone know of a working fix for the ie z-index bug? I have
I was hooking few functions in my code and it was working pretty code
I have been working now for few days on a small C program which

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.