WebSite X5Help Center

 
Jürgen Z.
Jürgen Z.
User

New project - database tables missing  en

Автор: Jürgen Z.
Просмотрено 674, Подписчики 2, Размещенный 0  

Hello,

I got a brand new X5PRO and made a new project as a proof of concept. Basically, I made just a standard project with one additional page, what has a database viewer and a dynamic object. It is a more sophisticated version of a previous project where I am linking a PLC driven industrial production plant model directly to a X5 website onlione shop, so that after an order has been placed the model factory is producing and "sending" the ordered goods :-) ...

Anyway, when exporting the project to our server and starting the new project, only a few tables are created in the newly made database and nothing more is happening ... When I check the apache and php log files I can see with which mysqli_sql_exceptions the x5engine stops and when I add the missing table by hand, slowly I am approaching a more or less working website (e.g. for the table of the dynamic objects I did not find the structure ...). I guess, this is not normal and therefore I wanted to ask what is wrong.

It is X5 PRO 2022.1, WINDOWS10 PC with a XAMPP application development environment, PHP 8.1.5 ...

The tables, which are created are:

When calling the home page of the project while those tables are created the message "Warning: Undefined array key "auto_increment" in E:\xampp\htdocs\autobau\res\x5engine.php on line 6057" appears 7 times on an otherwise blank webpage ...

The APACHE log is showing that the table "w5_4579ed22_cart_dynamicproducts" is missing when it throws an uncaught exception ...

If I add that table manually the website starts up ... and also the admin pages are working, because also

w5_4579ed22_analytics_visits

had been created automatically ... BUT, the admin dynamic content page is not working, because "w5_4579ed22_9_06_content" is missing and not created :-( ...

Website test from admin pages is working and SMTP mail can be sent ...

So, what is wrong here ???

Maybe, somebody could publish herer the structure of the ..._content table, that I could at least get the functions running so far that I can test my PLC connections ...

Hope for enlightenment,

Thanks, Jürgen

Размещено
7 Ответы
Jürgen Z.
Jürgen Z.
User
Автор

Well, 

found another problem:

There is a data table what is keeping tracks of the task, the PLCs are fulfilling in the automated production. This data table I have included in one page with the component DBVIEWER.

To my surprise the following is happing: I had one record in the table. When I go to the webpage with the DBVIEWER the structure is correctly shown, but no data records. If I export it from the export CSV button, the exported CSV is correctly filled with that one record. Furthermore, I can add another record, but on adding there is an error message communications fault. To my surprise the added data is correctly put into the table and also it appears in an CSV export  ...

table structure:

1 id Primärschlüssel int(11)  PRIMARY KEY

2 task int(11)

3 plc text utf8mb4_general_ci

4 start date

5 ende date

6 status int(11)

Somehow more puzzled, why my data is not shown and the add function is ending up in error ...

Accessed manually on a page, everything is fine :-(((

So, what is wrong here ?

Читать больше
Размещено От Jürgen Z.
Axel  
Axel  
User

Hello Jürgen,

PHP 7.x or 8.x ? try to use PHP 7.4

remove complete database and try to export agin with PHP 7.4 on your webserver

Hope this helps

Enjoy
Axel

Читать больше
Размещено От Axel  
Jürgen Z.
Jürgen Z.
User
Автор

Ok, it is PHP 8.1.5 ... will try to downgrade ...

Читать больше
Размещено От Jürgen Z.
Jürgen Z.
Jürgen Z.
User
Автор

Well, running the project now under PHP 7.4.10 ...

What has changed is, that now all database tables had been created at once on start. Error messages or warnings as described above, especially around the dbviewer component with its behavior have not changed ...

More puzzled than before ...

Читать больше
Размещено От Jürgen Z.
Incomedia
Stefano G.
Incomedia

Hello Jürgen 

In general, I would advise never to create tables by hand unless you're working with custom codes. Like if you want the Contact Form to save to a custom table, then you can of course create it by hand.

All other tables must be created automatically. In some cases, tables do not get created immediately after upload because they will create themselves later on. For example, this happens with the Automatic Registration. The table will appear only when the first user registers, not before

I would advise starting over without creating custom tables. 

Also, PHP Warnings, which are basically those errors you've encountered, should be disabled on a live website since they're only meant for development and will cause no real issues on your website if they're turned off

Please check in with your hosting provider to have them turned off

After all this has been done, try this all over again

Let me know if you still encounter trouble

Thank you

Stefano

Читать больше
Размещено От Stefano G.
Jürgen Z.
Jürgen Z.
User
Автор

Hello Stefano,

well, the warnings I switched off, that is not the problem. However, with PHP 8.1.5 ... the necessary tables on startup have NOT been created all by themselves, as I wrote in the first statement. I was creating the missing tables just for debugging purposes to give hints ...

From your code in x5engine.php etc. I got the idea of self creation of tables on first usage, but that failed under PHP 8.1.5, but worked OK under PHP 7.4.10 ...

And the problems with the dbviewer as decribed are persisting, also under PHP 7.4.10 ...

As I wrote the website is selfhosted, where I can do settings as I want on our university systems as required ..

Regards,

Jürgen

Читать больше
Размещено От Jürgen Z.
Incomedia
Stefano G.
Incomedia

Hello Jürgen 

I've attempted to export a new project onto a PHP 8.1 server without issues so I'm positive something must be different as far as the PHP configuration is concerned when you moved from PHP 7.4 to 8.1

Unfortunately, only by checking the server's errors or analyzing what failed in the process on your side can determine the exact reason why this isn't working for you

At the moment, the software is marked as officially supporting PHP 8.1

About the tables instead. I assume you now have the tables available in your Database and that you entered all the credentials in the Database Viewer Object to retrieve those.

Is it possible for you to share the page where the Object can be found with me here?

Could you also post a screenshot showing the content of the table as well as how the Database Viewer Object has been configurated?

If necessary, I can turn the topic private

Keep me posted here

Thank you

Stefano

Читать больше
Размещено От Stefano G.