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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:30:33+00:00 2026-05-30T22:30:33+00:00

Code: $sql = ‘UPDATE library/tablename ‘ . ‘SET foo1 = \’THIS IS A TEST\’,

  • 0

Code:

    $sql =      'UPDATE library/tablename ' .
           'SET foo1 = \'THIS IS A TEST\', foo2 = 1234567890, foo3 = 1234'.
           'WHERE foo4 = 165436';

    $stmt = db2_prepare($dbConn, $sql)
        or die("Error: Unable to prepare statement");

    $exec = db2_execute($stmt);

I run this in PHP and after it executes I go to look at the table and I see that the foo1 field has changed, but foo2 and foo3 remain their default values, which is zero.

If I run the $sql statement from “strsql” on the IBM terminal it runs and all fields are updated to the values I have specified. Does anyone have any idea as to what is going on here? This has had me stumped for hours.

  • 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-30T22:30:35+00:00Added an answer on May 30, 2026 at 10:30 pm

    After running the execute, you probably want to check the value of SQLSTATE. That will show you the actual error that DB2 is throwing at you.

    You can retrieve the SQLSTATE in PHP using db2_stmt_error(), which will give you the SQL state of the last execution (if you pass a particular resource, the last execution on that resource).

    If you’d like to output a human-readable SQL Error Message, you can use db2_stmt_errormsg(), which will output the SQLSTATE and the corresponding error message string.

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

Sidebar

Related Questions

This SQL Server 2005 T-SQL code: DECLARE @Test1 varchar; SET @Test1 = 'dog'; DECLARE
i try this code in sql server 2005 declare @userName nvarchar(50) set @userName='איש2' print
How do I write the SQL code to INSERT (or UPDATE) an array of
This is my code: string SQL = SELECT email FROM members WHERE subscribe=true; string
I'm debugging an app with the following code: sql = myTable Set datTable.Recordset =
in this SQL code DECLARE @n tinyint WHILE (@n > 0) BEGIN SELECT @n
So I have this sql code in Drupal: $query = db_query('SELECT wpv.nid, n.title, AVG(vote)
Suppose this is the SQL code of the table: CREATE TABLE `user_is_in` ( `id_user`
This is my SQL code SELECT p.plant_name, sum(data.value_1) totalvalue_1 FROM (SELECT DISTINCT date_format(date, '%Y-%m')
This is my sql code SELECT M.PartNo AS ModulePartNo, (SELECT SUM(Delivered - Allocated) FROM

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.