Hello all. Hope you are well. Please have a look at this screenshot. I'm trying to fix this error, but the error doesn't make sense to me. At first, I thought I had it-- as the database field was Int, and the app is passing an alphnum string. I changed the field from int, text which didn't work, then to varchar, which also doesn't work.

screenshot at imgur
https://i.imgur.com/7KbU5V0.png

I suspect it has to do with the GeoLib framework they're using. (same org, if i've posted about the apple farm here in the past... ugh... )

I haven't figured out where in that library it might be thinking that needs to be a datetime field. This thing is crazy: they have it set up w/ an MS Access DB on a PC in their office where they can scan pallet label barcodes into their .mdb prior to shipping. Then, once they update the local .mdb, it's setup to send a query to their MySQL... get this... wordpress database, remote. And they're using that GeoLib thing to do the database abstraction, though the docs explicitly state it has no abstraction layer. (don't ask, 'cause i have no idea. lol')

I just need to figure out why it's throwing that datatime error. I'm not a PDO expert, so your help is greatly appreciated.

    The mention of an incorrect datetime format is due to a changing meaning of the general sqlstate 22007 value between different database servers and can be ignored. What matters is the specific 1366 error number.

    After you changed the column definition, was the error message exactly the same and did you try to manually alter or insert a value into the column using your favorite database management tool?

    pbismad

    Hi there. Thank you SO much for attention to this.

    I have not attempted any manual queries. I'm actually doing this remote via assist.zoho.com (which is pretty cool, actually!)
    So. I had to change their ... connection info to attach to the development server, where i changed the database. That's about as far as i got. everything runs slowly as 8GB RAM isn't handling the load very well on my end, but... it's an adventure.

    The error messages appear to be identical prior and after my edits.

    EDIT:
    FWIW, this is what that section of the code looks like, in DBConnection.php

    screenshot

    The var_dump etc, i put in there trying to make sense of it. Apparently it doesnt' like my foreach loop to html. but, that's not the issue (and not shown in first screenshot)

      Could you show us the actual SQL that is being used? (Preferably the actual text copied/pasted here within [code]...[/code] tags). I.e., what is actually in that $sql string?

      NogDog
      Thank you. Sorry about that screenshot text. I couldn't copy / paste from that remote (basically disallowed, and a dialogue pops up), so i improvised. The following should be all of it, but i'm honestly not certain. Note: symbols that begin with geo (e.g. geoDB , which is Geolib Debug, not to be confused with database) is code from Geolib.

      <?php
      // @file DbConnection.php
      class DbConnection extends PDO
      {
          private $error;
          private $sql;
          private $bind;
          private $errorCallbackFunction;
          private $errorMsgFormat;
          public function __construct($dsn, $user = "", $passwd = "")
          { 
              $options = array(
                  PDO::ATTR_PERSISTENT => true,
                  PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
              );
              try {
                  parent::__construct($dsn, $user, $passwd, $options);
              } catch (PDOException $e) {
                  $this->error = $e->getMessage();
      geovar($this->error,'Error connecting to database');
              }
          }
          private function debug()
          {
              if (!empty($this->errorCallbackFunction)) {
                  $error = array("Error" => $this->error);
                  if (!empty($this->sql)) {
                      $error["SQL Statement"] = $this->sql;
                  }
                  if (!empty($this->bind)) {
                      $error["Bind Parameters"] = trim(print_r($this->bind, true));
                  }
                  $backtrace = debug_backtrace();
                  if (!empty($backtrace)) {
                      foreach ($backtrace as $info) {
                          if ($info["file"] != __FILE__) {
                              $error["Backtrace"] = $info["file"] . " at line " . $info["line"];
                          }
                      }
                  }
                  $msg = "";
                  if ($this->errorMsgFormat == "html") {
                      if (!empty($error["Bind Parameters"])) {
                          $error["Bind Parameters"] = "<pre>" . $error["Bind Parameters"] . "</pre>";
                      }
                      $css = trim(file_get_contents(dirname(__FILE__) . "/error.css"));
                      $msg .= '<style type="text/css">' . "\n" . $css . "\n</style>";
                      $msg .= "\n" . '<div class="db-error">' . "\n\t<h3>SQL Error</h3>";
                      foreach ($error as $key => $val) {
                          $msg .= "\n\t<label>" . $key . ":</label>" . $val;
                      }
                      $msg .= "\n\t</div>\n</div>";
                  } elseif ($this->errorMsgFormat == "text") {
                      $msg .= "SQL Error\n" . str_repeat("-", 50);
                      foreach ($error as $key => $val) {
                          $msg .= "\n\n$key:\n$val";
                      }
                  }
                  $func = $this->errorCallbackFunction;
                  $func($msg);
              }
          }
          public function delete($table, $where, $bind = "")
          {
              $sql = "DELETE FROM " . $table . " WHERE " . $where . ";";
              //geodb($sql,'thedeletesql');
              $this->run($sql, $bind);
          }
          private function filter($table, $info)
          {
              $driver = $this->getAttribute(PDO::ATTR_DRIVER_NAME);
              if ($driver == 'sqlite') {
                  $sql = "PRAGMA table_info('" . $table . "');";
                  $key = "name";
              } elseif ($driver == 'mysql') {
                  $sql = "DESCRIBE " . $table . ";";
                  $key = "Field";
              } else {
                  $sql = "SELECT column_name FROM information_schema.columns WHERE table_name = '" . $table . "';";
                  $key = "column_name";
              }
              if (false !== ($list = $this->run($sql))) {
                  $fields = array();
                  foreach ($list as $record) {
                      $fields[] = $record[$key];
                  }
                  return array_values(array_intersect($fields, array_keys($info)));
              }
              return array();
          }
          private function cleanup($bind)
          {
              if (!is_array($bind)) {
                  if (!empty($bind)) {
                      $bind = array($bind);
                  } else {
                      $bind = array();
                  }
              }
              return $bind;
          }
          public function insert($table, $info)
          {
              $fields = $this->filter($table, $info);
              $sql = "INSERT INTO " . $table . " (" . implode($fields, ", ") . ") VALUES (:" . implode($fields, ", :") . ");";
              $bind = array();
              foreach ($fields as $field) {
                  $bind[":$field"] = $info[$field];
              }
          
      $insertResult=$this->run($sql, $bind); // geodb($insertResult, 'insert result'); return $this->lastInsertId(); } public function run($sql, $bind = "") { $this->sql = trim($sql); $this->bind = $this->cleanup($bind); $this->error = ""; //geoDb($bind,'thebind'); try { $pdostmt = $this->prepare($this->sql); // EDIT 2022.10.18 !js /** THIS IS WHERE THE ERROR happens (as shown in screenshot) at the if() statement **/ echo '<br>' . __FILE__ . ' (at line: '.__LINE__.')<br>'; var_dump($this->sql); var_dump($this->bind);
      if ($pdostmt->execute($this->bind) !== false) { if (preg_match("/^(" . implode("|", array("select", "describe", "pragma")) . ") /i", $this->sql)) { return $pdostmt->fetchAll(PDO::FETCH_ASSOC); } elseif (preg_match("/^(" . implode("|", array("delete", "insert", "update")) . ") /i", $this->sql)){ // geodb(mysql_errno($link) . ": " . mysql_error($link),'last error'); return $pdostmt->rowCount(); } } } catch (PDOException $e) { $this->error = $e->getMessage(); $this->debug(); return false; } } public function select($table, $where = "", $fields = "*", $orderBy = null, $bind = "", $limit = null) { if (!$fields) { $fields="*"; } $sql = "SELECT " . $fields . " FROM " . $table; if (!empty($where)) { $sql .= " WHERE " . $where; } if ($orderBy) { $sql.=" ORDER BY ".$orderBy; } if($limit) { $sql.= "LIMIT ".$limit; } $sql .= ";"; //geoDb($sql,'select sql'); return $this->run($sql, $bind); } public function setErrorCallbackFunction($errorCallbackFunction, $errorMsgFormat = "html") { /* Variable functions for won't work with language constructs such as echo and print, so these are replaced with print_r. */ if (in_array(strtolower($errorCallbackFunction), array("echo", "print"))) { $errorCallbackFunction = "print_r"; } if (function_exists($errorCallbackFunction)) { $this->errorCallbackFunction = $errorCallbackFunction; if (!in_array(strtolower($errorMsgFormat), array("html", "text"))) { $errorMsgFormat = "html"; } $this->errorMsgFormat = $errorMsgFormat; } } public function update($table, $info, $where, $bind = "") { //geoVar($info,'info'); $fields = $this->filter($table, $info); //geoVar($fields,'fields'); $fieldSize = sizeof($fields); $sql = "UPDATE " . $table . " SET "; for ($f = 0; $f < $fieldSize; ++$f) { if ($f > 0) { $sql .= ", "; } $sql .= $fields[$f] . " = :update_" . $fields[$f]; } $sql .= " WHERE " . $where . ";"; $bind = $this->cleanup($bind); foreach ($fields as $field) { $bind[":update_$field"] = $info[$field]; } geodb($sql, 'updatesql'); return $this->run($sql, $bind); } public function write($table, $info, $where) { if ($where) { $this->update($table, $info, $where); } else { $this->insert($table, $info); } } public function fetch($table, $where = null, $key = null, $fields = "*", $orderBy = null, $limit = null) { if (($fields!="*") && $key && $key!==true) { $fields=$key; } $arr=$this->select($table, $where, $fields, $orderBy, null, $limit); if ($arr) { if ($key===true) { return $arr[0]; } elseif ($key) { return $arr[0][$key]; } $arr2=array(); foreach ($arr as $ar) { if(isset($ar["id"])){ $arr2[$ar["id"]]=$ar; } else { $arr2[]=$ar; } } return $arr2; } return array(); } }

      and the other

      <?php // @file _redacted_Update.php
      class _redacted_Update {
          private $mdb;
          private $wpdb;
          public function __construct($mdb, $wpdb){
              $this->mdb = $mdb;
              $this->wpdb = $wpdb;
          }
          
      public function preview(){ $text=""; $last_pallet_arr = $this->last_pallet_arr(true, true); $last_pallet_arr_wp=$this->last_pallet_arr(null, true); geodb($last_pallet_arr,'$last_pallet_arr'); geodb($last_pallet_arr_wp,'$last_pallet_arr_wp'); $text.=p("Last new pallet: ".$last_pallet_arr["Pallet_Tag_Number"]); $text.=p("Last pallet added to website: ".$last_pallet_arr_wp["Pallet_Tag_Number"]); $diff_count=$this->mdb->fetch("Pallet_Production",'ID > '.$last_pallet_arr_wp["ID"].' AND ID < '.$last_pallet_arr["ID"], null, "count(*)"); $diff_count=$diff_count[0]["Expr1000"]; geodb($diff_count,'diff count'); $diff_count++; if ($last_pallet_arr["Pallet_Tag_Number"] !=$last_pallet_arr_wp["Pallet_Tag_Number"]) { $text.=p("The website database is NOT up to date"). geoForm(geoSubmit("Update ".$diff_count." pallets",'update__redacted_')); } else { $text.=p("The website database is up to date"); } return div($text,'preview'); } // get the ID and/or Pallet_Tag_Number of the last updated pallet private function last_pallet_arr($mdb = null, $index = "Pallet_Tag_Number"){ if($mdb){ $db=$this->mdb; } else { $db=$this->wpdb; } $last_pallet_arr=$db->fetch("Pallet_Production",null, true, "ID,Pallet_Tag_Number", "ID desc"); if (!$last_pallet_arr) { $last_pallet_arr["ID"]=99000; $last_pallet_arr["Pallet_Tag_Number"]=62030003; } //geodb($last_pallet_arr,'last_pallet_arr'); if ($index===true) { return $last_pallet_arr; } else { return $last_pallet_arr[$index]; } } public function update(){ try { $last_pallet_id=$this->last_pallet_arr(null,"ID"); geodb($last_pallet_id,'last_palletid'); $result = $this->mdb->fetch("Pallet_Production",'ID > '.$last_pallet_id); if($result){ foreach($result as $row) { $this->wpdb->insert("Pallet_Production",$row); } } else { geodb($query,'bad Query?'); } }catch (Exception $e) { geodb($e->getMessage(),'Caught exception'); } } }

      i haven't had the chance to thoroughly examine the interplay w/ GeoLib. i think this is the only place where the actual SQL exists. EDIT: now that i've gone through a few times since first posting, I believe i'm incorrect about Geolib actually doing database stuff. it was that "geoDb" that had be confused (and mostly irritated) at first.

        I realize it's a lot. I'm sorry but i wanna do some Johhny Knoxville stuff to myself when I see "geolib" anywhere, because it seems really bad to me, now that I have some experience w/ the way WordPress works. I don't understand why they tried to put this in a WP database. They don't even have a wordpress site! Just using it for an interace to a shoddy custom plugin so the apple farm owner can do her label scans. Indeed, one of the most frustrating things i've ever had the misfortune of tangling with.

          Well, it looks to my eyes that the wpdb->insert() method should take care of my concern that maybe the values were being passed in the wrong order as compared to the field list. Unfortunately, that means I don't have any brilliant solution, either. 😕

          If the error message didn't change, that means that the column definition wasn't affected or you are changing something in a different database or table.

          There is a potential issue with this database code. It is using emulated prepared queries. This means that the PDO driver is actually building the complete sql query statement, with the values in it, and sending it to the database server upon the ->execute() call. Any string values, which are all the values, since they are being supplied as an array to the ->execute() call, are being escaped using whatever character set php is using. If this character set isn't the same as the database table(s) character set, a character conversion could cause an error like this one. It would be interesting to see what $dsn contains concerning the charset=... parameter and what the database table character encoding is set to.

          pbismad
          @pbismad , can you tell me how to find that? Or is it in this code. But, this is a good learning experience for me. I really appreciate you looking at the code like that.

          :aside: and not necessarily important to the topic...
          I'm thinking: whoever wrote this

          1. clearly knows at least something about code.

          2. They don't like to write HTML, so they use that Geolib thing, which is basically the long and short of that... like a PHP as Bootstrap CSS that no one ... knew existed. But,

          3. why they didn't just use the $wpdb, moreover,

          4. why even put an online, remote DB into the mix at all?

            I mean, they took me on a Mr Rogers type tour of the factory (via Zoom). It's a big deal! but I don't get this part at all (from an outsider's perspective). It's something to do, so I'm going with it.

            The PC I remote in to is their Office PC. That's where they have this archaic old, Win 3.1 or whatever DOS-like app, which clearly a database programmer designed, but it's a huge database and the sort of thing that works for this operation. They're able to make the barcode scan labels and put the data into that .mdb (it has ~ 2000k updates in the query to be executed, as this system has been down for months). And I worked on that WP plugin, trying to fix this apparently but i wasn't aware of it at the time. So I know how rather useless that part is. I guess it gives her a better summary view than what she's getting in that old desktop app interface. That has to be it. . And she can do it on her tablet. I guess it makes sense to have it online.

            If you are asking about the $dsn contents, near the top of the database class, in the __construct() method, there's a $dsn parameter. Just echo/print_r/var_dump that to see what it is.

              Thank you so much for your feedback. Sorry for my rambling last night.

              $dsn = 'mysql:dbname=pallets;host=domain.com';

              that's all that is. are you suggesting it should have charset data in there somewhere? i dont' understand.
              I've got myself all confused here. that $dsn is in my local file which i thought i shared here. in haste. i have to reexamine. thanks again.

                If the charset=... value is not set to match your database tables character set, a character conversion can take place over the connection between php and the database server. Also, since this code is using emulated prepared queries, sql injection is possible if these are not set the same.

                A typical setting would be -

                $dsn = 'mysql:dbname=pallets;host=domain.com;charset=utf8mb4';
                

                Where the utf8mb4 value would be the character set of your database tables.

                Of greater concern is if changing the column to a text or character type actually occurred and if it did, what is the current error.

                @pbismad got it. I upgraded their xampp to php7. of course i opened a whole new can of worms, but that must be done IMO. perhaps the upgrade will ultimately help to smoothe this out (id expect at least)

                (btw, i thought that's what you meant about the charset, i wasn't sure where to put it in the $dsn string. i'll try that as well)

                Edit:
                UGH! that's not going to work because, i think they have some kind of custom MDB driver. i think i'm just getting started. #@$%^&!!!!!!

                Error connecting to database: SQLSTATE[IM002] SQLDriverConnect: 0 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

                this is pretty unknown territory for me. i have a bit of .MDB / driver experience from back in the ColdFusion days, before i knew of MySQL.

                  Any suggestions as far as PHP version goes, regarding the use of the ODBC / .mdb database? i did enable

                  extension=pdo_odbc

                  (that's what i need, correct?)

                  I don't know if it ever even worked, w/ php5. so i don't know if it's worth it to try to stick w/ what they've got, considering it's not working.

                  On this, i could really use some stern advice. I know you guys have been at it longer and more in depth than i have.
                  i appreciate it.

                  Edit: I'm connected, but now i'm getting a new error:

                  Fatal error: Uncaught Error: Call to a member function execute() on null in C:\xampp\htdocs\includes\php\classes\DbConnection.php on line 154

                  that code hasn't changed, so i dont know yet why i'm getting this new error. i suspect, the php ver diff (5 vs 7).

                  i feel like im making progress at least. thank you again!

                    The last error means that the ->prepare() call failed and returned a false value. However, because this code is using emulated prepared queries, the existing error handling that would have told you why it failed, isn't being executed.

                    What is the actual database type? MySQL or MSSQL. If it is MySQL, you can set emulated prepared queries to false in the connection code, i.e. run real prepared queries, in which case you will get a pdoexception if the ->prepare() call fails. If you are using a MSSQL server, with the odbc driver, I'm pretty sure it doesn't support true prepared queries. In this case, you will need to temporarily add some debugging code.

                    At the point in the first posted code in this thread, where you added the - /** THIS IS WHERE THE ERROR happens ... comment and debugging statements, right after the ->prepare() call, add the following to get the pdo error information -

                    var_dump($this->errorInfo());
                    

                    Hi there. Thanks again for your help here!

                    This is what I'm getting from my var_dump's (there's probably more there now than when I first posted):

                    C:\xampp\htdocs\includes\php\classes\DbConnection.php (at line: 145)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:146:string 'SELECT count(*) FROM Pallet_Production WHERE ID > 165062 AND ID < 167057;' (length=73)
                    (this->sql ln: 146)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:148:
                    array (size=3)
                      0 => string '00000' (length=5)
                      1 => null
                      2 => null
                    (this->errorInfo: 148)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:152:
                    object(PDOStatement)[4]
                      public 'queryString' => string 'SELECT count(*) FROM Pallet_Production WHERE ID > 165062 AND ID < 167057;' (length=73)
                    (vdtemp ln: 152)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:153:
                    object(PDOStatement)[4]
                      public 'queryString' => string 'SELECT count(*) FROM Pallet_Production WHERE ID > 165062 AND ID < 167057;' (length=73)
                    (pdostmt ln: 153)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:154:
                    array (size=0)
                      empty
                    (this->bind ln: 154)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:157:
                    array (size=0)
                      empty
                    (this->bind ln: 157)

                    I added your recommended var_dump where it reads (this->errorInfo: 148)

                    Note: I did get this working when I set it up on my local development server. The update query is successful. Same DB's, etc (basically, aside from being truncated). That was using xampp (Windows 11). One database is MS Access .mdb, and the other is MySQL. I can't see what's different here, aside from that their MySQL DB is "remote" on a Linux server, and mine is local under Xampp. but, the php code is the same (sans a few var_dump and comments, etc).

                    EDIT: i see there's more/ different output after I submit the REQUEST to update the table:

                    (this->bind ln: 173)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php (at line: 145)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:146:string 'DESCRIBE Pallet_Production;' (length=27)
                    (this->sql ln: 146)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:148:
                    array (size=3)
                      0 => string '00000' (length=5)
                      1 => null
                      2 => null
                    (this->errorInfo: 148)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:152:
                    object(PDOStatement)[4]
                      public 'queryString' => string 'DESCRIBE Pallet_Production;' (length=27)
                    (vdtemp ln: 152)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:153:
                    object(PDOStatement)[4]
                      public 'queryString' => string 'DESCRIBE Pallet_Production;' (length=27)
                    (pdostmt ln: 153)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:154:
                    array (size=0)
                      empty
                    (this->bind ln: 154)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:157:
                    array (size=0)
                      empty
                    (this->bind ln: 157)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php (at line: 145)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:146:string 'INSERT INTO Pallet_Production (ID, Pallet_Tag_Number, Date_Printed, Time_Printed, Pack_Date, PackDate_Code, Quantity, Commodity, Pack_Location, Storage_Location, Storage_Room_No, Variety, Lid_Label, Size, Grade, Ship_Status, Date_Shipped, Time_Shipped, Qty_Shipped) VALUES (:ID, :Pallet_Tag_Number, :Date_Printed, :Time_Printed, :Pack_Date, :PackDate_Code, :Quantity, :Commodity, :Pack_Location, :Storage_Location, :Storage_Room_No, :Variety, :Lid_Label, :Size, :Grade, :Ship_Status, :Date_Shipped, :Time_Shipped'... (length=528)
                    (this->sql ln: 146)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:148:
                    array (size=3)
                      0 => string '00000' (length=5)
                      1 => null
                      2 => null
                    (this->errorInfo: 148)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:152:
                    object(PDOStatement)[4]
                      public 'queryString' => string 'INSERT INTO Pallet_Production (ID, Pallet_Tag_Number, Date_Printed, Time_Printed, Pack_Date, PackDate_Code, Quantity, Commodity, Pack_Location, Storage_Location, Storage_Room_No, Variety, Lid_Label, Size, Grade, Ship_Status, Date_Shipped, Time_Shipped, Qty_Shipped) VALUES (:ID, :Pallet_Tag_Number, :Date_Printed, :Time_Printed, :Pack_Date, :PackDate_Code, :Quantity, :Commodity, :Pack_Location, :Storage_Location, :Storage_Room_No, :Variety, :Lid_Label, :Size, :Grade, :Ship_Status, :Date_Shipped, :Time_Shipped'... (length=528)
                    (vdtemp ln: 152)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:153:
                    object(PDOStatement)[4]
                      public 'queryString' => string 'INSERT INTO Pallet_Production (ID, Pallet_Tag_Number, Date_Printed, Time_Printed, Pack_Date, PackDate_Code, Quantity, Commodity, Pack_Location, Storage_Location, Storage_Room_No, Variety, Lid_Label, Size, Grade, Ship_Status, Date_Shipped, Time_Shipped, Qty_Shipped) VALUES (:ID, :Pallet_Tag_Number, :Date_Printed, :Time_Printed, :Pack_Date, :PackDate_Code, :Quantity, :Commodity, :Pack_Location, :Storage_Location, :Storage_Room_No, :Variety, :Lid_Label, :Size, :Grade, :Ship_Status, :Date_Shipped, :Time_Shipped'... (length=528)
                    (pdostmt ln: 153)
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:154:
                    array (size=19)
                      ':ID' => string '165357' (length=6)
                      ':Pallet_Tag_Number' => string '22020015' (length=8)
                      ':Date_Printed' => string '2022-07-21 00:00:00' (length=19)
                      ':Time_Printed' => string '09:09:33' (length=8)
                      ':Pack_Date' => string '2022-07-21 00:00:00' (length=19)
                      ':PackDate_Code' => string '202-01' (length=6)
                      ':Quantity' => string '42' (length=2)
                      ':Commodity' => string 'APPLES' (length=6)
                      ':Pack_Location' => string '_redacted_ Cold Storage' (length=19)
                      ':Storage_Location' => string 'PCS HIGHLAND REF. ROOMS' (length=23)
                      ':Storage_Room_No' => string 'R01' (length=3)
                      ':Variety' => string 'DELICIOUS RED' (length=13)
                      ':Lid_Label' => string 'S/R  B&B' (length=8)
                      ':Size' => string '3 lb' (length=4)
                      ':Grade' => string 'US EXTRA FANCY' (length=14)
                      ':Ship_Status' => string 'N' (length=1)
                      ':Date_Shipped' => null
                      ':Time_Shipped' => null
                      ':Qty_Shipped' => string '0' (length=1)
                    (this->bind ln: 154)
                    ( ! ) Warning: PDOStatement::execute(): SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'R01' for column `_redacted_`.`Pallet_Production`.`Storage_Room_No` at row 1 in C:\xampp\htdocs\includes\php\classes\DbConnection.php on line 156
                     
                    C:\xampp\htdocs\includes\php\classes\DbConnection.php:173:
                    array (size=19)
                      ':ID' => string '165357' (length=6)
                      ':Pallet_Tag_Number' => string '22020015' (length=8)
                      ':Date_Printed' => string '2022-07-21 00:00:00' (length=19)
                      ':Time_Printed' => string '09:09:33' (length=8)
                      ':Pack_Date' => string '2022-07-21 00:00:00' (length=19)
                      ':PackDate_Code' => string '202-01' (length=6)
                      ':Quantity' => string '42' (length=2)
                      ':Commodity' => string 'APPLES' (length=6)
                      ':Pack_Location' => string '_redacted_ Cold Storage' (length=19)
                      ':Storage_Location' => string 'PCS HIGHLAND REF. ROOMS' (length=23)
                      ':Storage_Room_No' => string 'R01' (length=3)
                      ':Variety' => string 'DELICIOUS RED' (length=13)
                      ':Lid_Label' => string 'S/R  B&B' (length=8)
                      ':Size' => string '3 lb' (length=4)
                      ':Grade' => string 'US EXTRA FANCY' (length=14)
                      ':Ship_Status' => string 'N' (length=1)
                      ':Date_Shipped' => null
                      ':Time_Shipped' => null
                      ':Qty_Shipped' => string '0' (length=1)
                    (this->bind ln: 173)

                    Looks like the (this->errorInfo: 148) is now related to the DESCRIBE statement? or, is it the this->sql? i don't normally debug like this. am I correct that the line 148 var_dump(_this->error) is RE: the array (size=3)
                    0 => string '00000' (length=5)
                    line, and NOT below at C:\xampp\htdocs\includes\php\classes\DbConnection.php:152:
                    object(PDOStatement)[4]
                    public 'queryString' => string 'INSERT INTO Pallet_ ...
                    ?


                    EDIT: I see they're running php 5 on their remote development server, so that's one major difference:
                    PHP Version 5.6.40-60+0~20220627.67+debian10~1.gbp1f7ffd

                    ajaxStardust EDIT: i see there's more/ different output after I submit the REQUEST to update the table:

                    That was the whole point of the debugging that is going on. You were getting an error when you performed that operation.

                    You are now getting the initial error about the - Incorrect integer value: 'R01' for column _redacted_.Pallet_Production.Storage_Room_No ...,, which means that the definition for that column is for an integer datatype, not for a string datatype.

                    pbismad

                    Thank you SOOOO much for helping me through that. It was very kind, and thoughtful of you, and very much appreciated.

                    screenshot

                    It was that column field all along-- that simple change from Int to varchar is all it required. Everything moves slowly w/ that remote connection, and I did get confused about the development / production server database names. I did something wrong at some point regarding that, but...
                    i'm super happy now! I actually worked on that thing since May! (albeit, not since July, but it came back to haunt me! lol)

                    Thanks again. phpbuilder.com rocks!
                    😃

                    Write a Reply...