I just went to the Mariadb config file and added: sql-mode = ‘’ "
That made the database work fine with the PHP code I’m using. I know that my code is not up to date but I have tons and tons of it on my website. I took me 5 years to write it all and I can’t change it overnight. This is a “stop gap” measure, but it will take me a long time to re-write everything. I’m a one man team so I can’t just put 10 people to work on it!
My code works under PHP 7.4 and even if I jump to 8.0 it stops working. It may be more efficient to just redo the whole site a section at a time. Being a tiny company with limited money and resources all these changes present a daunting task… so when I find things like this that make it still work I use them.
The only problem I’ve run into is that the backup portion of Virtualmin will not work with this little bit of code in the Mariadb config file. So every time I need to back things up I have to remark it out and restart the database server. Then once things are backed up I need to restore the code, restart the database server and we’re good to go until I need to backup the next time. If there were some workaround for this that would be great because under the current circumstances I can’t automate the backups. I need to do them manually.
The problem I have is not reading the databases with the current PHP code… the problem is updating it and entering new records.
For example… when I go to enter in a new record that contains blank fields here is the error I get back:
INSERT INTO allshows2 (ID, yearnumber, monthnumbr, month, showbegin, showend, totaldays, hours, deadline, showname, location, spacesize, setuptime, area, contacname, position, organizati, street, city, state, zip, phone, phone2, faxnumber, costoutdor, costindor, electric, attendance, admitchrg, amountchrg, numvendors, performanc, mallshow, juried, juryfee, catagories, awards, elegiblety, promoter, comments, comments2, comments3, comments4, comments5, comments6, foodinfo, hhrating, ourcomment, paidfee, datefeepai, email, carrierrt, delivpoint, logofile) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Field ‘latecomer’ doesn’t have a default value
If every field has a value it works. Since I was just trying to enter a new blank record I got an error in every field. The problem seems to be with the blank fields. The Mariadb does not like blank fields obviously. But I dont’ always have data for every field so it’s necessary for me to be able to enter as such. A lot of times we come back later and enter the new data into the fields as it’s available. Probably 50% of the 30,000 or so records in my database are missing some data.