Page 1 of 1

Not updating other records after server move

Posted: Wed Apr 02, 2025 11:09 am
by ricklincs
I have a form pickhead with a subform pickitems. On as save I run the following:

Code: Select all

$sql = "UPDATE pickhead SET pickhead.status = 'INPROGRESS' WHERE pickhead_id = '#RECORD_ID#'";
nuRunQuery($sql);
$sql2 = "UPDATE pickitems INNER JOIN pickhead ON pickitems.pickhead_id = pickhead.pickhead_id SET pickitems.pick_date = pickhead.pick_date WHERE pickitems.pickhead_id = '#RECORD_ID#'";
nuRunQuery($sql2);
$sql3 = "UPDATE pickitems INNER JOIN pickhead ON pickitems.pickhead_id = pickhead.pickhead_id SET pickitems.pick_no = pickhead.pick_no WHERE pickitems.pickhead_id = '#RECORD_ID#'";
nuRunQuery($sql3);
$sql4 = "UPDATE pickitems INNER JOIN pickhead ON pickitems.pickhead_id = pickhead.pickhead_id SET pickitems.complete = pickhead.complete WHERE pickitems.pickhead_id = '#RECORD_ID#'";
nuRunQuery($sql4);
$sql5 = "UPDATE stkbody INNER JOIN pickitems ON stkbody.stkbody_id = pickitems.pstkbody_id SET stkbody.status = 'PICKED', stkbody.pick_date = pickitems.pick_date, stkbody.pick_no = pickitems.pick_no WHERE pickitems.pickhead_id = '#RECORD_ID#'";
nuRunQuery($sql5);
$sql7 = "UPDATE pickhead SET pickhead.status = 'OUT' WHERE pickhead_id = '#RECORD_ID#' AND pickhead.complete = 'COMPLETE'";
nuRunQuery($sql7);
this used to work and update pickhead, pickitems and stkbody, however now I have moved server it comes up with a gateway error and doesn't update stkbody. Php settings and verisons are the same, the only thing different is MariaDB has changed from 10.6.16 to 10.6.21 I have tried changing PHP-FPM settings as my host suggested. Anyone see this behaviour before?

Re: Not updating other records after server move

Posted: Wed Apr 02, 2025 5:24 pm
by kev1n
Add nuDebug($sql) after the line nuRunQuery($sql), then inspect the output to check what the SQL looks like and whether the Hash Cookie is resolved.

Re: Not updating other records after server move

Posted: Wed Apr 02, 2025 5:42 pm
by Janusz
Hi,
Except that - maybe on other form - can you add, modify or delete records?
What system are you using?
Anything in the nuDebug or ..apache2/error.log?

Normally with such simple sql I don't think it's a problem with MariaDB - I've never experienced a problem directly related to MariaDB. if you run the following directly in phpMyAdmin substituting any existing value for #RECORD_ID# - is it OK?

UPDATE pickhead SET pickhead.status = 'INPROGRESS' WHERE pickhead_id = '#RECORD_ID#'

(or use in phpmyadmin line generated directly from nuDebug($sql) )

Re: Not updating other records after server move

Posted: Thu Apr 03, 2025 9:30 am
by ricklincs
Hi Kev1n and Janusz, found the problem, for some reason when I moved the mariaDB over to the new host it changed the collation of one table to utf8mb3_unicode_ci, (table was stkbody which is my main subform) then any INNER JOIN statement didn't work. Fingers crossed all seems to be working fine now thank you. I asked chatgpt.com what could be happening and it gave me a list..