Confused about why db2_bind_param is not doing anything

77 Views Asked by At

So I am trying to edit my DB, which has HTML stored in it. I am trying to replace the max-width:auto; css styling with a max-width:100%;.
I figured the best way would be to use db2_bind_param in order to avoid sql errors, and safely enter my data into the DB.
However, the db2_bind_param does not seem to be doing anything and I am not sure why?
Here is my code below:

foreach($as400response as $as){
            //string to replace, and declared variables
            $newPARV = str_replace('width: auto;', '100%', htmlentities($as['PARV']));
            $newSKU = $as[SKU];
            $newSPRC = $as[SPRC];
            $newFLDDEF = $as[FLDDEF];
            //mysql query format
            $fix = "update swind.pimpd set parv=? where sku=? and sprc=? and flddef=?";
            //prepare connection
            $stmt =  db2_prepare($conn, $fix);
            // bind parameters
            db2_bind_param($stmt, 1, 'newPARV', DB2_PARAM_IN);
            db2_bind_param($stmt, 2, 'newSKU', DB2_PARAM_IN);
            db2_bind_param($stmt, 3, 'newSPRC', DB2_PARAM_IN);
            db2_bind_param($stmt, 4, 'newFLDDEF', DB2_PARAM_IN);
            //execute query
            db2_execute($stmt, array());
            // display error messages 
            print_r(db2_stmt_errormsg());
        }

I am not getting an error message, but there is also no change in the DB's values.
If anyone could help me out with why this isn't working I'd greatly appreciate it :)

0

There are 0 best solutions below