794 comments found.
Hi. How reonect to DB? Session has expired. Please connect the CRUD to your database again.
Hi,
I’m not sure to understand what happened, as the DB connection doesn’t depend on the PHP session, but try to close & reopen your browser, it’ll start a new PHP session.
If it doesn’t help it probably means that your issue is not related to the CRUD.
This message appears when I try to create a category in Admin navbar. Before that I installed Authentication module and then deleted it.
But if you don’t know this error, I will reinstall CRUD.
Hello, I would like to use your solution. Is it possible to allow users to see only certain table records (not all), based on certain fields in that table (Example: ID or status)? The aim is to display only the fields that concern them.
Hi,
Yes, the authentication module allows you to create users roles and profiles, and you can assign the appropriate rights to read, edit and create/delete table by table. If your table has a relation with the user you can restrict the rights to his own records.
This is explained here: https://www.phpcrudgenerator.com/tutorials/user-profiles-and-rights
I always write in English here but I’m French too.
If you need anything else you’re welcome,
Gilles
Bonjour Gilles,
C’est plus simple pour moi du coup … Oui, je comprends bien.
Je souhaite gérer mes données d’une base MySQL. L’idée serait d’interdire la lecture de certaines informations à certains usagers.
Mais du coup, c’est possible d’ajouter plusieurs utilisateurs, par exemple ID=8 ou ID=21 dans la base (Au lieu de =) ? Sachant aussi que certains droits sont liés à des ID de profil et non de personne. On peut mettre en place des variables ou truc assimilé pour cela ?
Merci d’avance pour votre retour. Frédéric
Bonsoir,
Lorsque tu crées des profiles tu peux restreindre les droits pour chaque table avec une requête du style: “WHERE table.user = USER_ID”
USER_ID est l’identifiant de l’utilisateur connecté.
Hello, Is it possible to add an image field to forms? In addition to that, is it possible to add multiple images for a single entry? For example, in your demo, would it be possible to add (multiple) images to films?
Hi,
You can add image fields and setup your preferences (max. width/height, auto-generation of thumbnails), but you cannot add multiple images with a single field.
The reason is it would be complicated to manage the edition of them: how to, for instance, replace the 2nd image and keep the others?
The solution is to create multiple fields in your table, or a separate table for the images with an external relation (i.e. an intermediate table)
I have this errors when try to submit a form: PHP Warning: Use of undefined constant EXPORT – assumed ‘EXPORT’ (this will throw an Error in a future version of PHP) in /home/mypage/public_html/admin/class/crud/ElementsUtilities.php on line 131 PHP Warning: constant(): Couldn’t find constant ADMIN_DASHBOARD in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant CUSTOMIZE_THEME_AND_NAVBARS in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant TOGGLE_FULL_SCREEN in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant VIEW_DETAIL in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant CUSTOMIZE_THEME_AND_NAVBARS in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant ADMIN_DASHBOARD in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant CUSTOMIZE_THEME_AND_NAVBARS in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant TOGGLE_FULL_SCREEN in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant CUSTOMIZE_THEME_AND_NAVBARS in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant SEARCHING in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369 PHP Warning: constant(): Couldn’t find constant TYPE_2_OR_MORE_CHARACTERS in /home/mypage/public_html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1369
Hi Marcos,
Thanks for purchase.
The constants are defined in admin/i18n/[your-language].php
admin/data-forms.php loads /conf/conf.php (the main configuration file)
/conf/conf.php loads /conf/user-conf.json (the user custom configuration file) in which your language is set
Then it includes the constants of your language L.78: ADMIN_DIR . 'i18n/' . LANG . '.php'
If you need more help you can email me your FTP access, then I’ll have a look.
Gilles
Hi.
I purchased your PHP CRUD Generator some time ago. I installed it in test machines that do no exists (or anyway for the sake of God I cannot remember where I installed it!
)
I bought another license. But, is there any mean to recover old license?
Hello, i have presale question. With this i can normaly connect to my firebird databse and get data?
Hi,
Yes, PHPCG is Firebird ready.
If you need anything else you’re welcome,
Gilles
For a script that I will buy from codecanyon for a single use, can I make a SAAS for it with your solution ? Like managing subscriptions and features ?! Thanks
Hi,
I don’t know what you’re planning, but there’s nothing specific with PHP CRUD Generator license. You’ll find all the details here: https://codecanyon.net/licenses/faq
I had some time ago this clarification from Envato’s team:
Customers can only develop a single application per license and may not redistribute it (except to one end client, say, as a freelance project). If it is being distributed like that, a new regular license for each user is required. Customers are not allowed to simply purchase a license and sell item as stock elsewhere.
Hi, I have some pre-sale queries. 1. Is it possible to create different user based on table or role? 2. how the data analytics part on the admon Dashboard was created .can have a custom chart/table there? Thanks
Hi,
- You can create per-table user’s profiles: user can read/create & delete/update table.
You can also restrict the rights for the users to their own records only.
And you can assign any profile to any users.
More information here: https://www.phpcrudgenerator.com/tutorials/user-profiles-and-rights - The charts are built with ApexCharts.
I didn’t include them into the package because they refer to the demo database,but I can provide you the code. Basically you just have to create a php file, query your database the way you want and add the Javascript to create & customize your charts. You can add them to the home page but also on any others.
If you need anything else you’re welcome,
Gilles
But the all dashbord/table/chart can be viewed by any user, or he visualize the assigned table?
No, if a user has not the “read” rights on a table the table won’t be available for him (not in the navigation, and of course no page).
1. Is it possible to link data from one table to another? 2. Can fields be optional and mandatory in the table?
Yes of course. Everything is explained in the tutorials.
Hi, i have a table related with another one having a lot of fields. Is there any way to show more than 2 fields? I need to show at least 5-6 fields.
Thank a lot!
Hi,
The generator will not do it for you but you can edit the appropriate code to achieve this. Here’s how to proceed:
- Open admin/class/crud/[Table].php in your code editor
- Find the line where the columns for the query are ste. It starts with “
$columns =“ - Add the columns you want to display into them. Always add the table name beforefield name (ie: “table.column)
- Find the code part which loops the records. It starts with “while ($row = $db->fetch()) {“
- Add your values to the appropriagte column. Eg:
$this->column_name[] = $row->field . ' - ' . $row->field2 . ' - ' . $row->field3;
If you want you can email me your FTP and other details, then I’ll have a look.
Gilles
Thanks!
You’re welcome
I have error when click “Open The Admin Page” showing 404 Not Found.
Hi,
Thanks for purchase.
Please first read & try this: https://www.phpcrudgenerator.com/help-center#error-404
If you still have the problem feel free to email me your FTP & URL, I’ll then have a look
Gilles
Hello
I have recently migrated from windows to mac and I am having a lot of troubles. I have tried mamp, xampp and ampps,
Initially I had installed using mamp and everything was working fine but the database version was old and I couldn’t upgrade it so I have tried have since tried both xampp and ampps both unsuccessfully, I am unable to run a generated form.
Initially I thought it was because I wasn’t getting a clean install but I have definitely gotten everything removed and I have tried installing them multiple times and I always get the same result. Then I thought the problem might be permissions but I have tried opening the permissions to all.
What happens is that I can generate a form (it appears to generate anyway) but it isn’t there. I currently have xampp installed and it says 404 – object not found.
I have installed your software under htdocs in a folder php-crud-generator and my .htaccess has # Options +FollowSymLinks -MultiViews commented out and RewriteRule . /php-crud-generator/admin/index.php [QSA,L]. added
I am new to mac and I expect I may be missing something simple….because initially using mamp everything worked fine.
Thanks Jane
Hi Jane,
I’m on PC and know almost nothing about mac. I work with MAMP PRO, and recently discovered Laragon which seems to be a good choice too.
I can suggestion a few other things:
- Try to open php-crud-generator/admin/home in your browser. If it works it means you have no problem with .htaccess & rewrite rules.
- When you generate a list or form, check if the files are generated in the admin folder. If they’re not it probably means that you have a permissions issue. You should then google “how to give write permission to folder in mac”
- The problem doesn’t seem to be related to a database issue, but to the 404 error. Double-check that you don’t have a .htaccess at the root that might interfer with the admin rules
I hope it’ll help you,
Gilles
Hi, i’m getting access error when i create new user. Password shows not encrpyted and i think the problem is password saving.
Please, could you help me?
Thanks!
Hi. How can I remove “raw” from the table heading? THX
Hi,
It’s a typo in generator/generator-templates/item-list-template.php. I already patched the Codecanyon’s package ; please make the following change:// find this code: }}|raw // replace with: |raw }}
Then rebuild your lists, or make the same change to them in admin/templates
If you need anything else you’re welcome,
Gilles
Hello! I want to use your solution to connect a MariaDB database, with 10 million records. Will this work?
All I want is to create filters and searches in an advanced way, combining several fields in my database.
Is PHP CRUD Generator for me?
Thank you!
Hi,
Yes, it’ll work.
When you add your filters enable Ajax loading. This way your 10 million records won’t be loaded on page load and PHPCG will use Ajax and autocomplete the values when you start typing.
You can see a live example at https://www.phpcrudgenerator.com/admin/actor with the actor’s “name” filter.
If you need anything else you’re welcome,
Gilles
Thanks for the answer. I will buy!
One last question, is it possible to limit the number of records that a user can read/export?
Could I create this adaptation with the help of a PHP dev?
Hi,
You can choose the number of records displayed in each list, of course you can custmoize it in the code easily. If you need something more specific I might do it for you, or at least guide you on how to proceed.
Hi,
with my licence code i dont have any active websites. On the Installation it says, “Unfortunately, installation failed because of this reason: The maximum number of allowed PHP CRUD Generator installations (2 installation(s) total) reached”
cannot install? Unfortunately, installation failed because of this reason: An unknown error occurred (probably database failure or unauthorized modification of data
Hi,
Your problem and its solution are explained here: https://www.phpcrudgenerator.com/help-center#unknown-error-occurred
If you need anything else you’re welcome,
Gilles
Not sure where to install php crud generator. Our company domain houses all our database files and we have five website domains that access the company databases. Not sure where to install the crud generator scripts??
followed all help instructions and not able to proceed as installation continues to fail- “An unknown error occurred” not much of a help but seems to be all we are told? Spent good part of the day trying to setup and at this time we just need to get back to our work!
Hi,
I’m sorry you have these difficulties and will do my best to help you quickly and efficiently.
I need first to understand how your company works. Please email me or try to reach me on chat at https://www.phpcrudgenerator.com/, and give me some details:
- How many databases do you have
- How many domains do you have
- Which domain uses which database
If you can send me the access: FTPs, URLs, Database credentials (hostname, username, password) I can do the job and make it work for you
Else I’ll tell you how to proceed.
Hello, how are the images saved? Should I create a folder on the server? and in the database put the route?
How can I give validation to a field, I want to give validation to the unique database field.
Hi Bizino,
Thanks for purchase.
It’s always more convenient to save only the image filename in your database rather than the route. This way if someday you change the route your data is still right.
In the generator, when you choose “image” for an input the options are displayed. You can then set the images path and URL.
The image folder must exist and be writable. You don’t have to enter the complete path from your server root, just enter the path from the root of your project without the beginning slash. E.g, if your root path is /home/www/myproject/assets/images/, you have to enter “assets/images/”.
Hovers over the question marks and tooltips will give you all the details.
About unique database fields: you have to query your database to find if the posted value already exists or not, then trigger an error manually.
PHPCG uses PHP Form Builder.
- Open your form in your code editor (admin/inc/forms/yourtable-edit.php)
- Find the validation part in the code, which starts with
$validator = Form::validate('form-edit-yourtable', FORMVALIDATION_PHP_LANG); - Add your database query and register the error if it returns a record. Something like this:
// connect to the database $db = new DB(); // send the query $value = $db->selectValue('mytable', 'myfield', array('myfield' => $_POST['myfield'])); // register the error if a record exists if ($value !== false) { // create a tricky validation which always throws an error */ $validator->maxLength(-1, 'This value already exists.')->validate('myfield'); }
Here’s some links to the documentation:
https://www.phpformbuilder.pro/documentation/class-doc.php#database-overview
https://www.phpformbuilder.pro/documentation/db-help.php#selectValue
https://www.phpformbuilder.pro/documentation/class-doc.php#php-validation-examples
Thank you for your response, and what type of field should I give in the database for the photo. Another question, why don’t they load the calendars in the forms? What is the correct configuration for the calendars to be displayed?
Hi,
The images fields can be varchar, nothing spcial, it stores only the files names.
For calendars (date pickers), set the fields types to “date” or “datetime”.
There’s probably something wrong with the image url you set.
Do you see any error message in the browser’s console?
If you want you can reach me now on chat at https://www.phpcrudgenerator.com
go
has odbc conection?
Hi,
No, it supports firebird, mysql, oci & pgsql, I didn’t work on ODBC yet.
Good Morning Giles
Can you guide me to lock the field for the user not to edit it once the status is changed.
Example: There is a field Payment Status (Drop Down) when the value is changed to Requested then the user should not be able to edit that field
Thanks
Hi,
Here’s how to proceed:
- Create a Javascript file in admin/inc/forms/ with the same item name as in the form file. For instance: a table named “my-table” will be admin/inc/forms/mytable.js.
The JS file will be automatically loaded with the create/edit/delete forms. - Add this code to the Javascript:
loadjs.ready('core', function () { if ($('select[name="name-of-you-select"]')[0]) { $('select[name="name-of-you-select"]').on('change', function (e) { if ($(this).val() == '') { $(this).attr('readonly', 'true'); } }); } });
Replace ‘name-of-you-select’ with the real name of your select field - Test
I hope I didn’t make any mistake in the code because I cannot test it, but that’s the idea.
If you need anything else you’re welcome,
Gilles
PS: if you like PHPCG won’t you please drop a rating on Codecanyon? Thanks!
Thanks Gilles, i tried as you mentioned but it did not worked
Also how to post the review?
Thanks for your excellent review!
I made a mistake in the code, please try it again with the following replacement:# old wrong code:
if ($(this).val() == '') {
# replace with this one:
if ($(this).val() == 'Requested') {
Double-check that the option value is the same (“Requested” with the first letter capitalized)
I’m connected now, so you can also reach me on my chat at https://www.phpcrudgenerator.com
Hi migli
I would like to know how to disable some fields from editing?
While generating the list, i have selected some fields Edit in place as disabled. When i am trying to edit inline these fields are showing as read only which is perfect.
However when i click on Edit icon on the left of the record, it is taking me to edit mode and i can edit all the fields. Here also i need some fields to be read only. Please guide
Also after creating the users, What will be their url to login? for admin login it showing as
domain.com/crudfolder/admin/login
Hi,
Thanks for purchase.
The forms are located in crudfolder/admin/inc/forms/ (the admin structure details are available here: https://www.phpcrudgenerator.com/tutorials/admin-panel-tree-structure-files-and-logic)
- Open
[table]-edit.php(where [table] is the name of your db table) in your code editor - The form is build with PHP Form Builder: https://www.phpformbuilder.pro/. Edit the fields and add “readonly” to the arguments. This will do the job. E.g.:
$form->addInput('text', 'user-name-1', 'value', 'User Name', 'required, readonly');
When you add users to the admin you must enter their email and password. This will be their login.
If you need anything else you’re welcome,
Gilles
Thanks a lot Gilles, it worked.. However i made the date field readonly it is working but it showing the date as Dec 03, 1900 where as the actual date is 01 March 2023
The date issue is probably not related to the readonly, but to a date formatting issue. The value from your database should be ‘2023-03-01’, and the form should understand it.
Did you change the date format in the CRUD generator?
Date & time format management is a big challenge, you’ll find all the details here, but I don’t know if it can help you: https://www.phpcrudgenerator.com/tutorials/date-time-formats-management-logic-for-coders
Else I’d need your CRUD, Admin & FTP access to help you with this.