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

  • Home
  • SEARCH
  • 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 6338737
In Process

The Archive Base Latest Questions

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

$params[‘title’] is a string and $params[‘feed’] is an integer. Column’s ‘title’ type is varchar

  • 0

$params['title'] is a string and $params['feed'] is an integer. Column’s ‘title’ type is varchar and column’s ‘feed’ type is integer. The PHP code is:

$this->db->where('title', $params['title']);
$this->db->where('feed', $params['feed']);
$query = $this->db->get('news');

So everything should be fine, BUT…

A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'riots: intense anger after deaths of three young men AND `feed` = '1'' at line 3
SELECT * FROM (`news`) WHERE `title` = Birmingham riots: intense anger after deaths of three young men AND `feed` = '1'
Filename: C:\path\system\database\DB_driver.php
Line Number: 330

Of course, it’s obvious why an error occurred. Is there any way to fix it (apart from not using active record class)? Looked at CI’s documentation, but have no idea why this problem occurred.

EDIT

Solved by changing to

$this->db->where('title', (string) $params['title']);

And other clause accordingly. And now have a bunch of identical errors in other models. Well, I guess the only solution is to add var type everywhere manually.

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

    It looks like this SimpleXML class’s title property isn’t a string.

    You could simply cast it to a string as soon as you get it, instead of waiting until you do the insert.

    data['title'] = (string) $item->title;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code works fine: Bundle params = new Bundle(); params.putString(to, String.valueOf()); mFacebook.dialog(, feed, params,
I have this: var sortName = Request.Params[sortName]; var query = Request.Params[query]; Func<UsuarioEndereco, bool> whereClause
function Request(params) { // Stuff stuff stuff // And then $.ajax( { type: 'GET',
this is the code: params = dict(request.REQUEST.items()) but i think it is not necessary
Grouped params: <?php class Form { private $field; public function getFieldRelated($field) { return $this->fieldrelated[$field];
I have this code : def create login(params[:email], params[:password]) if current_user flash[:notice] = Welcome
there can be variable number of params being sent through a query string. in
I have one document in my params collection like this: { _id: ObjectId(4d124cef3ffcf6f410000037), code:
Given this hash that comes though :params positions=>{ 1=>{x=>50, y=>30}, 2=>{x=>22, y=>53}, 3=>{x=>68, y=>35}
I am doing this: @person.attributes = params[:person] Can anyone give me a clue as

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.