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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:06:50+00:00 2026-05-22T17:06:50+00:00

Code igniter is spitting out: A Database Error Occurred Error Number: 1064 You have

  • 0

Code igniter is spitting out:

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 'TEST, `cardNumber` = 411111........11, `cardExpiry` = 1212, `authCode` = 110200,' at line 1

UPDATE `pxpayRequest` SET `status` = 'approved', `cardName` = Visa, `cardHolder` = VISA TEST, `cardNumber` = 411111........11, `cardExpiry` = 1212, `authCode` = 110200, `dpsTxnRef` = 0000000800b51dde, `dpsMessage` = APPROVED WHERE `id` = 1

And, as is obvious it is due to the missing sets of '

Why is code igniter not putting these in properly?

Here is my code:

$id = $result->MerchantReference;
$cardName = $result->CardName;
$cardHolder = $result->CardHolderName;
$cardNumber = $result->CardNumber;
$cardExpiry = $result->DateExpiry;
$authCode = $result->AuthCode;
$dpsRef = $result->DpsTxnRef;
$dpsMessage = $result->ResponseText;

$this->db->set('status', 'approved')
         ->set('cardName', $cardName)
         ->set('cardHolder', $cardHolder)
         ->set('cardNumber', $cardNumber)
         ->set('cardExpiry', $cardExpiry)
         ->set('authCode', $authCode)
         ->set('dpsTxnRef', $dpsRef)
         ->set('dpsMessage', $dpsMessage)
         ->where('id', $id)
         ->update('pxpayRequest');

You can see the associated values by looking at the query above.

Here is the print_r of $result

SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [valid] => 1
        )

    [Success] => 1
    [TxnType] => Purchase
    [CurrencyInput] => NZD
    [MerchantReference] => 1
    [TxnData1] => SimpleXMLElement Object
        (
        )

    [TxnData2] => SimpleXMLElement Object
        (
        )

    [TxnData3] => SimpleXMLElement Object
        (
        )

    [AuthCode] => 121132
    [CardName] => Visa
    [CardHolderName] => VISA CARD
    [CardNumber] => 411111........11
    [DateExpiry] => 1212
    [ClientInfo] => 125.236.220.238
    [TxnId] => 4ddd9aa1dd14c
    [EmailAddress] => SimpleXMLElement Object
        (
        )

    [DpsTxnRef] => 0000000800b5d3c9
    [BillingId] => SimpleXMLElement Object
        (
        )

    [DpsBillingId] => SimpleXMLElement Object
        (
        )

    [AmountSettlement] => 8.00
    [CurrencySettlement] => NZD
    [DateSettlement] => 20110526
    [TxnMac] => BD43E619
    [ResponseText] => APPROVED
    [CardNumber2] => SimpleXMLElement Object
        (
        )

    [IssuerCountryId] => 0
)
  • 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-22T17:06:51+00:00Added an answer on May 22, 2026 at 5:06 pm

    Quite odd: on any recent CodeIgniter that should work correctly. The only thing I can think of that might be off is that the db library isn’t correctly identifying your database, or those variables are somehow not being identified as strings (so no escaping is happening). What does echo is_string($cardName); say?

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

Sidebar

Related Questions

I am trying to work out the code igniter routing I have a url
I'm trying out code igniter, and I came across an error message while trying
in code igniter you can type: $query = $this->db->query(YOUR QUERY); foreach ($query->result() as $row)
I have started learning Code Igniter and I am very impressed, and have had
I have some problems using Code Igniter and I feel there is something I
Am getting the error in the code igniter view page as Invalid argument supplied
I'm new at code igniter and I'm trying to figure out how to utilize
I am using code igniter to retrieve data from a database What is returned
I am using code igniter to retrieve data from a database What is returned
Looking some frameworks like Code Igniter I see they use a defined check on

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.