792 comments found.
Hi,
Can the one installation of PHP CRUD Generator handle 2 databases on the same server?
Regards, Mark
Hi,
PHP CRUD Generator can handle 2 databases on the same server but you have to copy the package to 2 different places and install from each of them.
If you need anything else you’re welcome,
Gilles
Hi
I have 2 tables: books and authors (schema below).
I have created an Edit page for ‘books’ where the field ‘book_author_id’ has a select menu to choose the author_name from the ‘authors’ table.
The ‘book_author_id’ looks up the ‘author_name
That’s all good on the ‘books’ Edit page.
But, on the ‘books’ Read page, I cannot figure out how to get the ‘author_name’ to display in place of the ‘book_author_id’
There are no foreign keys in place.
Any clues would be grately appreciated.
Regards, Mark
books
—-—-—---—-—---—-—-—---—-—-—+
| Field | Type | Null | Key | Default | Extra |
—-—-—---—-—---—-—-—---—-—-—+
| id_book | int(10) | NO | PRI | NULL | auto_increment |
| book_title | varchar(255) | YES | | NULL | |
| book_author_id | int(11) | YES | | NULL | |
—-—-—---—-—---—-—-—---—-—-—+
authors
—-—-—-—-—---——-—-——-—-——+
| Field | Type | Null | Key | Default | Extra |
—-—-—-—-—---——-—-——-—-——+
| id_author | int(10) | NO | PRI | NULL | auto_increment |
| author_name | varchar(255) | YES | | NULL | |
—-—-—-—-—---——-—-——-—-——+
Hi Listgnome,
Thanks for purchase.
You mentionned the key point: There are no foreign keys in place.
To display the author name instead of the author id in the book list the query must use the book_author_id as a foreign key pointing to the authors table, so you have to create this relation first in your DB:
- Add the relationship in your database
- From the generator, click the “Refresh” button, then in the dropdown choose “Refresh the database relationships”
- The options to display the authors names instead of the authors ids will be available, you can setup and rebuild your list.
This might help about relationships: https://www.phpcrudgenerator.com/tutorials/how-to-manage-database-relations
If you need anything else you’re welcome,
Gilles
Thank you very much Gilles. That has got me up and running 
Great. Thanks to you for your feedback.
Hi,
I am trying again your software if I can install it now. I just made a fresh install of the new version. Installation is a success. But when I click the OPEN THE CRUD GENERATOR NOW. The new tab has error:
This page isn’t working. florabelgroup.com.ph is currently unable to handle this request. HTTP ERROR 500
Pls help.
Thanks
Database already contain one table, still same error.
Hi,
The error 500 can have several causes, you have to turn dusplay_errors On in your php configuration, then refresh your page to see the error message, that will help to understand where the error come from. Or find your php error.log and see the reported error.
After this if you still need some help you can write here or email me your ftp access and URL if you want me to have a look on your server.
Gilles
In the Error_log:
[21-Sep-2024 18:43:28 UTC] PHP Parse error: syntax error, unexpected ’|’, expecting ’;’ or ‘{’ in /home1/abetroid/public_html/quickhire/class/phpformbuilder/FormExtended.php on line 710
Thanks, it helps.
Please open your /class/phpformbuilder/FormExtended.php and make the following replacement:
// L.710 private function getIndex($i): string|false // replace with this: private function getIndex($i): mixed
The alternative “string|false” syntax requires php 8, you have an older php version, that why you got this error.
I’ll publish this fix in the next release.
Gilles
Bonjour,
Est-il possible d’utiliser PHPCG sur des vues ? je n’arrive pas à voir les vues disponibles …
Merci
Philippe
Bonjour,
Pourrais-tu préciser ta question? je ne vois pas exactement ce que signifie “utiliser PHPCG sur des vues”
je crée des vues sous MySQL (CREATE VIEW) et elles ne sont pas affichées dans PHPCG uniquement les “vraies” tables .. Est-ce qu’il y a quelque chose que j’ai manqué ou c’est normal ?
- Les enregistrements ne pourraient pas être édités, ça serait un simple affichage
- Il serait impossible d’utiliser des relations
- Il me faudrait implémenter les vues pour chaque SGBD
Y’a-t-il une possibilité dans la version actuelle d’afficher simplement celles-ci ? C’est assez utile pour des consultations / extractions de données … (via une petite modification de code
)
Il faudrait que tu implémentes ta propre classe PHP pour la vue, le mofdèle TWIG associé, et que tu ajoutes la vue au menu latéral: https://www.phpcrudgenerator.com/tutorials/how-to-add-links-to-custom-pages-in-the-navbar
Bonjour,
Après une installation sur 2 hébergements différents, j’ai à chaque fois la même erreur :
URL : https://xxx.com/generator/generator.php Erreur 500. Niveau logs :
AH01071: Got error ‘PHP message: PHP Warning: Undefined array key 0 in /home/xxx/php-crud-generator/generator/class/generator/Generator.php on line 403; PHP message: PHP Warning: Undefined array key 0 in /home/xxx/php-crud-generator/generator/class/generator/Generator.php on line 404; PHP message: PHP Warning: Undefined array key 0 in /home/xxx/php-crud-generator/generator/class/generator/Generator.php on line 405; PHP message: PHP Fatal error: Uncaught TypeError: phpformbuilder\\Form::addInput(): Argument #3 ($value) must be of type string, null given, called in /home/xxx/php-crud-generator/generator/generator.php on line 82 and defined in /home/xxx/php-crud-generator/class/phpformbuilder/traits/Elements.php:27\nStack trace:\n#0 /home/xxx/php-crud-generator/generator/generator.php(82): phpformbuilder\\Form->addInput()\n#1 {main}\n thrown in /home/xxx/php-crud-generator/class/phpformbuilder/traits/Elements.php on line 27’
Est-il possible de me faire un retour rapidement ?
Cordialement,
Philippe
Bonjour Philippe,
Le generator essaie de charger une table depuis la base de données, qui apparemment n’en contient pas.
Il faut simplement utiliser le CRUD Generator avec une base de données qui contient au minimum 1 table.
Si tu as besoin d’autre chose n’hésite pas,
Gilles
Merci Gilles, c’est bon. Dernière question
est-il possible d’ajouter du code php nativement ? Merci !
Oui, les classes et templates générés par le CRUD Generator peuvent être personnalisés, tu peux aussi y ajouter des scripts.
Ceci devrait t’aider:
https://www.phpcrudgenerator.com/tutorials/admin-panel-tree-structure-files-and-logic
et des infos ici sur tout ce qu’on peut couramment voiloir faire: https://www.phpcrudgenerator.com/tutorials
Hello, Can your software be used to build a new postgresql database from scratch?
Hi,
PHP CRUD Generator generates your admin dashboard from your database, but it doesn’t create your tables and fields.
I tried to update, but now I get this:
Fatal error: Uncaught UnexpectedValueException: The stream or file ”/var/www/html/generator/update/update.log” could not be opened in append mode: failed to open stream: Permission denied in /var/www/html/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:146 Stack trace: #0 /var/www/html/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(48): Monolog\Handler\StreamHandler->write() #1 /var/www/html/vendor/monolog/monolog/src/Monolog/Logger.php(327): Monolog\Handler\AbstractProcessingHandler->handle() #2 /var/www/html/vendor/monolog/monolog/src/Monolog/Logger.php(539): Monolog\Logger->addRecord() #3 /var/www/html/vendor/visualappeal/php-auto-update/src/AutoUpdate.php(446): Monolog\Logger->notice() #4 /var/www/html/generator/update/index.php(45): VisualAppeal\AutoUpdate->checkUpdate() #5 /var/www/html/generator/generator.php(1076): require_once(’/var/www/html/g…’) #6 {main} thrown in /var/www/html/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 146
And cannot access the CRUD generator anymore
I set permissions to 777 and now I can access again, but update fails
Hi Migli I am getting HTTP ERROR 500 after trying to reach site from my subdomain http://crud.mydomain.com/generator/generator.php is blank.
Is there something with subdomain to do or what ? can you please help
or
maybe .htaccess
Hi Robife,
You should first turn display_errors On in your php.ini to view the details of the error, which mighrt becaused by different things.
Then if you still need help please email me your FTP and URL, I’ll see what happens.
Thanks so much for your rating and comment, much apprecfiated!
Gilles
Fatal error: Uncaught TypeError: phpformbuilder\Form::addInput(): Argument #3 ($value) must be of type string, null given, called in generator/generator.php on line 82 and defined in
class/phpformbuilder/traits/Elements.php:27 Stack trace: #0 /generator/generator.php(82): phpformbuilder\Form->addInput('hidden', 'table-to-reset', NULL) #1 {main} thrown in /phpformbuilder/traits/Elements.php on line 27
this is error i get
Hi,
Did you open the generator whereas your database contains no table? Your database must have at least one table.
oh thank you that worked 
Perfect!
I have another question. If I use a column with type ENUM in MySQL, will the views display the ids or the values?
No worries. I have discovered it already. Works nicely
And another question. I see that there is an update, but I cannot find any changelog. I would like to know which fixes/improvements are there before installing it
Hi,
The changelog is available here: https://www.phpcrudgenerator.com/documentation/index#changelog
I’ll answer your filter question within a few minutes
Thank you. I see that it says version 2.3.7 (09/2023), I guess it is 09/2024.
Yes, 2024 of course. Thanks, I made the change
When I create a filter to select, for example, the records with a boolean value of 0, it shows all the records. If you select 1, if filters the records correctly. It also happens if you try to find records with an empty field
It used to work fine before, but it looks like something has since been broken. I’ll work on it and will publish a fix but I need some time to test and make sure everything is working in all situations with any kind of field.
In the meantime if you want you can email me your access (FTP + URL) and I can make a quick fix on your project.
Gilles
Ok. We will wait for your fix. Thank you for the answer
I just published the update, please open your generator, you’ll see the available update and just have to click the “install” button.
The filters should now work with empty values, NULL and zero values.
Please let me know if everything is ok now for you,
Gilles
Hi, Gilles. I am experiencing again the same problem with the filters that I reported 2 months ago. I don’t know if there has been any update that I haven’t seen
Did it work before?
The update is version 2.3.8. You can find the version you use in conf/conf.php
I think it worked with 2.3.8, but now I have 2.3.9
2.3.9 can’t have broken this. If you want you can email me your access (FTP + phpmyadmin) and explain exactly how to reproduce the issue, then I’ll check it.
Hi, Gilles. I am checking in your demo app, and it neither works there: https://www.phpcrudgenerator.com/admin/customer the filter Active/Non active doesn’t do the job properly If you select 0 there still active customers in the list. If you choose 1, it works fine
Damn, you’re right!
A file was forgotten during the update. I’m finishing up a few other changes and then publishing a new version. Unless I’m mistaken, everything should work fine. Thanks for your patience.
Hi, Gilles. I have seen and applied 2.3.10. The filter works now! Thank you!
Great, thanks for your feedback
Hi, I bought PHP CRUD Generator but when I try to configure with the Production server, I always received an error that remote connecetion does not work, even when I tried to test the connection an always receives the message that connection was succesfully I am using Namecheap as hosting provider, please can you help me to solve this issue.
Hi,
I am aware of the problem and am currently working on it urgently. It’s due to an internal change at my host, and we’re closely studying it together. At this time the problem is largely solved, but not yet 100%. Everything should be back to normal in the next few hours.
The license verification system has always been extremely reliable over the years,
Thank you for your patience and understanding.
Gilles
Hi Gilles,
I tried starting from scratch. remove the whole folder and copied a fresh copy of the installer.
I get this error on STEP 2:
Unfortunately, installation failed because of this reason: An unknown error occurred (probably database failure or unauthorized modification of data)
I checked and the installer can’t create the table user_data which I already deleted also before installing.
Thanks, Herbert
Hi Herbert,
Did you read this? : https://www.phpcrudgenerator.com/help-center#unknown-error-occurred
You probably have to restore the original database connection file /class/phpformbuilder/database/db-connect.php from PHPCG package
Hi,
I already replace the file from original Download but still same error.
Table user_data not found
Replace /home1/abetroid/public_html/nanaypartylist.com/class/phpformbuilder/database/db-connect.php original file to reset your installation
Connection to remote server can’t be established
I just want to fresh copy to start the project. Thanks
Hi Herbert,
Please read “How to clean up your installation” here: https://www.phpcrudgenerator.com/tutorials/how-to-uninstall-reinstall-php-crud-generator
If you follow the process (delete your user_data” table and restore the original db-connect.php) you shouldn’t encounter any problem.
Also double-check that the MySQL user has the appropriate rights to create tables.
If you still have any problem please email me and send me the information I need to install: purchase code, DB connection information, FTP access and if possible PHPMyAdmin access.
Thanks
I have already bought PHP Form Build and am using it for my project. Is there a way i can implement both on the same project without conflict? Also, do i get a discount?
Hi,
If you buy PHP CRUD Generator you’ll have to remove PHP Form Builder from your project and use the version which is included with PHP CRUD Generator.
I cannot make a discount for a single purchase, but I can allow more installations with your license, which means that you’ll be able to use PHP CRUD Generator on 2 projects instead of one with a sibngle purchase.
Gilles
Hi.
I have a Birth Date field. In the Date Picker, i need to scroll to all the months just to get to the correct year and it is taking to long to encode Birth Date. Is there a way to scroll to the years so encoding will be fast?
Also, how can I search a name if the First Name and Last Name are two different Field?
Hi,
PHP CRUD Generator uses PHP Form Builder and its “pickadate” plugin.
You can easily edit the form code and add year / month selectors:
1. open your form from admin/inc/forms/ in your code editor 2. find the line which creates the birth date input 3. add ”, data-select-years=true, data-select-months=true” to enable the dropdowns
You’ll find some code examples here: https://www.phpformbuilder.pro/documentation/javascript-plugins.php#pickadate-example
2nd question about search on name + first name:
Create a filter in advanced mode and include the name + first name in your query: https://www.phpcrudgenerator.com/tutorials/add-filters-to-bootstrap-admin-list-view
You can then use the select search box to filter your list.
If you open the generator, scroll down to the “Filters (drop-down lists to filter results)” then click the “need help?” button you’ll see an example of advanced filter settings that uses the same parameters (name + first name)
If you need anything else you’re welcome,
Gilles
Hi Gilles.
The Year and Month dropdown appeared but for the year, when you click it, only a few year appears. It doesn’t scroll to earlier year. Is there a way to just type the date in the input box?
The examples on PHP Form Builder’s website show how you can set minimum / maximum dates.
It’s also possible to set your input only as a “normal” text input.
If you want you can email me the detail (ftp access, the form url and what you want me to do exactly) then I can do it for you.
Hi Again,
If I set it to Normal Text Input, will it still gets validated as a DATE field? How can I prevent wrong input of Dates?
If you change the field type in the form code but don’t change the validation code part it’ll still be validated as a date with $validator->date()->validate('your-fieldname');
The validation documentation is here: https://www.phpformbuilder.pro/documentation/class-doc.php#php-validation-methods
It’s also possible to add a pattern to the input: https://www.html5pattern.com/Dates
Hi,
This is the existing code when I re save it in Form Builder:
// birthdate— $form->addPlugin(‘pickadate’, ’#birthdate’); $form->addInput(‘text’, ‘birthdate’, ’’, ‘Birthdate’, ‘data-format=mm dd yyyy, data-format-submit=yyyy-mm-dd, data-set-default-date=true’);
To have a text input with a pattern, replace everything with:
$form->addInput('text', 'birthdate', '', 'Birthdate', 'pattern=(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31)), placeholder=yyyy-mm-dd, required');
You can replace the pattern with another from https://www.html5pattern.com/Dates
If you want me to help you more with code please email me your details, it’ll be more practical for me and a lot more efficient.
Thanks
Hi. I have sent a PM. Thanks
I can no longer recommend PHPCG due to:
- Basic functions like adding rows trigger license checks, causing failures with “Can’t connect to licensing server” errors when the licensing server is slow or unresponsive.
- While the creator is very responsive and initially resolved bugs, promised updates to fix these issues in a new release haven’t materialized.
- Setting up on a new server requires going through the same troubleshooting process again, which is not feasible for production work.
To the developer: Consider a licensing system that doesn’t interrupt core functionality, and follow through on promised bug fixes.
Hi,
About the license checks issue:
There has been an act of sabotage on the Internet network in France, affecting many servers. The network players are at work, so unfortunately there’s nothing to do but wait for services to be restored.
News about my hosting provider Planethoster is posted here: https://planethoster.live/threads/incident-reseau-paris-fr-network-issue-paris-fr.6719/
I hope you can understand that the whole network is affected, many users of many tools have the same problems.
About the updates & releases
If you have some requests you just have to contact me, I can publish a release with the latests changes if you ask for it.
If you need anything else you’re welcome,
Gilles
License checks for basic functions is a terrible design. Consider a licensing system that doesn’t interrupt core functionality. About the bugs, you’ve already replied by email that you’re busy with a different update when I contacted you.
If you email me I’ll find our previous exchange and try to help.
Hello support, readonly not working in edit form
Hi,
Please provide me some details: I need your url, ftp and purchase code. You can email me here: miglisoft contact
Thanks
hi, i have installed PHP CRUD generator in XAMP. after i try to open the generator i am getting following error. and the page is not loaded properrly. could you please help with this issue.
Warning: Undefined array key 0 in C:\xampp\htdocs\generator\class\generator\Generator.php on line 403
Warning: Undefined array key 0 in C:\xampp\htdocs\generator\class\generator\Generator.php on line 404
Warning: Undefined array key 0 in C:\xampp\htdocs\generator\class\generator\Generator.php on line 405
Hi,
Thanks for purchase.
The generator didn’t find any table in your database. You have to add at least one table first.
Buenas tardes! Estoy necesitando conectar php crud generator a sqlsrv (Sql server) me podría indicar que driver utilizar y si tengo que configurar algo en especial.
muchas gracias!!
Hi,
Thanks for purchase.
Sql server uses the PHP PDO_SQLSRV driver, which is not currently implemented with PHP CRUD Generator. I can only suggest you to migrate your database to another DB Engine, got no other solution for you, except if I make this development for you but it might be a bit expensive …
Gilles