Code

Discussion on PDO Crud – Advanced PHP CRUD application (Form Builder & Database Management)

Discussion on PDO Crud – Advanced PHP CRUD application (Form Builder & Database Management)

Cart 2,301 sales

ddeveloper supports this item

Supported

2608 comments found.

Hi there, I am getting this error:

Parse error: syntax error, unexpected T_FUNCTION in C:\wamp\www\mydomain\script\classes\PDOCrud.php on line 2446

can you please help? thanks

Hi Sure, we are here to help. It may be because of file not extracted properly.Please try again with latest code. In case of your issue doesn’t get resolved, you can send access details, we will do installation for you. Thanks

from 16c13414-43c2-47e0-aebf-aa49030058dc – 2 May 2018 REGULAR LICENSE johnryemansfield@gmail.com

action column shows these…

http://localhost/ipdocrud/script – Notice: Undefined variable: key in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 85 - – Notice: Undefined variable: action_val in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 89 - Notice: Undefined variable: type in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 91 - Notice: Undefined variable: text in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 93 - Notice: Array to string conversion in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 95 Array – - Notice: Undefined variable: colName in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 99

Notice: Undefined index: in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 99

Notice: Undefined index: i in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 102 http://localhost/ipdocrud/script – dt87z2CiZe – - javascript:; – default – – Notice: Array to string conversion in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 95 Array – - Notice: Undefined index: in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 99

Notice: Undefined index: i in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 102 http://localhost/ipdocrud/script – AK549gJMIT – - javascript:; – default – – Notice: Array to string conversion in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 95 Array – - Notice: Undefined index: in C:\Bitnami\drupal-7.58-0\apache2\htdocs\iPDOCrud\script\classes\templates\bootstrap\template-table.php on line 99

Hi Please share your code you check it or you can send us details via email using profile page to check out this. Thanks

does not function properly. just change config and index errors show up. ex change employee to another table. thanks

Hi,

Please share code and config file else please give us access to check. It is difficult to figure out issue without this information. Please send us details, via email using profile page, we will do it for you. Thanks

Hi,

checkDuplicateRecord works great when inserting a data record, but how do I apply it when updating a record in the database – for example when editing/changing a username!?

Nvm, I managed this from the callback script.

Ok. great. Thanks

Hi

I bought and installed the script under http://admin.brokertools.be/ script http://admin.brokertools.be/script there is an issue with table layout.

purchase code 4ff35810-11fb-47cd-a1ca-0d90974b785b

Hi,

You have entered incorrect url in $config[“script_url”]

Your url https://admin.brokertools.be/script/script/

Correct url

https://admin.brokertools.be/script/

remove script as it is repeating.

Thanks

Hello, There’s a problem with this script. Tested on Firefox, IE, Chrome on Windows.

Falied to load [MY_DOMAIN]/script/pdocrud.php: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin [MY_DOMAIN] is therefore not allowed access.

It happens when I try to edit a record from the Actions colum, the script crashes with endless spinner. Could you please fix it?

Hello, this is still not working. Missing CORS header Access-Control-Allow-Origin

Hi,

You can send url to check it. Or you can send access, we will check and correct it. Thanks

I sent your a private message from your profile, thank you.

Hi…just purchased your product. I use a similar product called xcrud, but it can’t select tables from other databases besides its primary database. Is this possible with your product? Thanks.

Hi,

It allows select tables from primary database only. Thanks

Hi there,

I have run into some trouble with the Logical Condition Events Function and I believe this function should be rethinked.

The first issue is that when using fieldConditionalLogic this is only great when inputting data, but fails to have any application when editing the data as the value of the select option only hides the input fields on change action.

The second issue I ran into is the fact that this function is not compatible with fieldAddOnInfo, which is not the end of the world for me but I think this can be fixed.

The third issue is that when using fieldTypes select + fieldDataBinding, I can not add a class using fieldCssClass.

And the final issue is that even though the select field has a generated ID, it uses the same ID for both the insert and update forms, making the implementation of a jquery onselect function unable to work.

This is a great feature but I believe it needs a lot of tweaking before it becomes really useful! The only solution os far for me is to make the fields that I had to hide into fieldNotMandatory and avoid the fieldConditionalLogic altogether.

Also, if I could make a small recommendation: there are some broken pages that don’t work as intended on the demo page (such as http://pdocrud.com/demo/pages/view-col-formatting ) and also there are some small code mistakes in the user management demo page as well. It would also be great if we can have a search field on the left bar so we can easily find what we need instead of endlessly scrolling through. And just a final thought, you guys could benefit a lot if you would do some YouTube examples of how to use the code and expand on the callback function examples as they are a vital factor to this platform! This will both make your documentation more refined and get you more views and potential sells ofc :)

Hi

Thanks a lot for your suggestions regarding few functions and YouTube. We will surely update you on this. Thanks

I don’t understand this example: http://pdocrud.com/demo/pages/plugin-datatable. Where or how is the datatable plugin loaded? Regarding this comment ” You will have most of the grid/table functionality using this.”. Will bulk edit work with the plugin?

Hi,

The datatable is jquery based plugin as you may know. We have added this plugin in that example. This plugin modifies table data like it adds their own search, paging etc so we have to hide the features that conflicts with this plugin that’s why we have written that comment.Thanks

Regarding Advance filter options – Currently it support three types of controls – dropdown, radio button and textbox. More options will be available in future versions. <- is it possible to do a multiselect on a dropdown? If not is that something you are working on, and if so when will it be available?

Hi,

Yes, we are trying to add all available html fields. There is no definet date for release of this feature but we will try to add it asap.Thanks

Hi,

I’m using

$pdocrud = new PDOCrud(false, “pure”, “pure”);

$pdocrud->checkDuplicateRecord(array(“user_name”));

echo $pdocrud->dbTable(“login”)->render();

which works but the problem is that it does not display the error message: “Record already exists” ( http://pdocrud.com/demo/pages/check-duplicate-before-insert ), and simply closes the form and goes back to the table. How can I fix this!? Thanks!

So where can I edit this behavior in the files!?

I will check if it’s possible, then we will show this message at table. Will let you know. Thanks

Thank you! :)

Hi,

I have the following code that updates my last login session for the logged user in index.php:

<?php

$lastLoginTime = $pdocrud->getUserSession("lastLoginTime");
$userId = $pdocrud->getUserSession("userId");
$updateData = array("last_login_date"=>"$lastLoginTime");
$pdomodel = $pdocrud->getPDOModelObj();
$pdomodel->where("user_id", $userId);
$pdomodel->update("login", $updateData);

?>

how can I add this into $pdocrud->addCallback(“before_table_data”, “beforeTableDataCallBack”); callback function? I am aware that I require an array, but I can’t seem to figure out how to make $pdocrud->getUserSession(array(“userId”, “lastLoginTime”)); get passed in the function and execute the update operation. Can you give me the right code for this:

function beforeTableDataCallBack($data, $obj) { ??? }

Thank you!

Also could you tell me how can I change the names of the form buttons: save, save& back, back and cancel? They are a bit misleading!

Hi, 1. You can add callback function and in the function, you can access the session value to modify the $data array. This way, data will be changed as per your requirement and will be updated.

2. You can change all these values directly in language/en.ini file.

Thanks

Hi,

I have a specific case where I would want to edit a user. Now, when I edit him all the fields will be populated with data, including the password field. In this situation I would want to make the following:

- set the field as empty in the edit form by default – I tried using $pdocrud->formFieldValue(“password”, ””); but it only applies on the insert form

- set the field as not required – in this case, I can use $pdocrud->fieldNotMandatory(“password”); but I believe it also makes this true for the insert form. So how could I set this only for the edit form?

- if the field is empty then the password will not be updated in the database, else it will add the new encrypted value

Thank you!

Hi,

You can define different fields for insert and update from version 3.3 Please check http://pdocrud.com/demo/pages/form-fields Thanks

For anyone having the same issue as me, here is my solution to the password problem:

<?php

//Before Update Password

function beforeUpdateCallback($data, $this) {

$pdocrud = new PDOCrud();
$pdomodel = $pdocrud->getPDOModelObj();
$userName = $data"login"; // get form username
$db_pass = $pdomodel->where("user_name", $userName)->select("login"); // Select from login table db
$password = $db_pass0; // get table db password
if($data"login" != $password)  // check form password vs db password
{
    $data"login" = sha1($data"login");
}else{
    $data"login" = $password;
}
return $data;

}

?>

This way you avoid encrypting your already encrypted password! The comment section does not parse the code correctly, so there are some square brackets automatically removed from the code, I don’t know how to make it work but at least it should point you in the right dirrection!

Hi,

Just bought the extension but I have the following question:

I set up a simple multi table relation (nested tables) for my orders and customers table. So an order shows the related customer. If an order has no customer attached I have an option to add a new customer. But I don’t have an option to select an existing customer. How can I achieve this?

Oh and when I try to add a new customer I receive the error message: SQLSTATE23000: Integrity constraint violation: 1062 Duplicate entry ‘1’ for key ‘PRIMARY’

So it tries to give the new customer an id 1 which is already taken. How can I fix this?

Looking forward to your reply! Best regards,

Bart Sallé

Hi, you can view the test code online via: http://crud.veercarpets.nl/

I created a customer to order #1. Now I want to lookup and attach this customer in order # 2. But the customer can’t be found. How can I fix this?

Hi,

We need to see the code you are using so that we can know the issue. We are able to see your demo but not the code. So please send that Or you can send the access details via email also, we will do this setup for you. Thanks

Followed your instructions: pear is installed and path in php.ini looks good Idea?

Warning: Division by zero in users.php on line 395

Warning: require_once(php”): failed to open stream: No such file or directory in /users.php on line 395

Fatal error: require_once(): Failed opening required ‘php”’ (include_path=’.:/usr/share/php:/usr/share/php/PEAR’) in /users.php on line 395

Hi,

Yes, I got the email and replied as well. You have asked for our IP address and we have sent it. Please check. Thanks

did you get my email last night?

Hi,

Yes, and I have already resolved the issue and sent you email also.

https://airdesignercms.com/test.php

It was showing some garbage character in test.php file that was the reason it was not working. We have corrected it. Please check.Thanks

Thanks

Hi there,

I got your wonderful script, with the purchase code: c64dce29-1d5d-4555-8a9a-11d84acd1910 , and I have 3 main issues:

1. I managed to set up the login/registration form, but I can’t figure out how to output the session data correctly. In the case of the provided demo db for ‘login’, if I print the $_SESSION[“data”] it will output: Array ( [0] => Array ( [user_id] => 5 [user_name] => 123 [email] => a@a.a [password] => 40bd001563085fc35165329ea1ff5c5ecbdbbeef [role] => 123 [last_login_date] => 2018-10-05 [status] => 123 ) ). The moment I try to echo it as $_SESSION“data” it doesn’t show up. How should I solve this and how can I limit what is placed in the session array as having the password thrown in, is not really desirable for security reasons. Perhaps I am missing something in the documentation or demo about how to handle pages after the login session starts!?

2. In the dropdown records per page option – when I select 10, 25, etc it shows them correctly but when I click back the “Select” option (which I assume is empty), I get this error on the page: SQLSTATE42000: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’’ at line 1 . I have no clue where and how to fix this, but I suspect the query is not encapsulated somehow.

3. How can I change the loading animated wheel in the middle of the page when I perform an action? I would like to add a better looking animated icon if possible.

This are the pages in question: I set the login to load the index page with a random parameter to avoid any chache issues! http://domustouch.com/meetings/log.php http://domustouch.com/meetings/index.php

Thank you for your time!

For 4. This is my code:

require_once ‘script/pdocrud.php’;

$pdo_crud = new PDOCrud();
$pdo_crud->addCallback("before_select", "beforeloginCallback");
$pdo_crud->addCallback("after_select", "afterLoginCallBack");
$pdo_crud->formFields(array("user_name", "password"));
$pdo_crud->formRedirection("http://domustouch.com/meetings/?".date("Ymd").time());
echo $pdo_crud->dbTable("login")->render("selectform");

and the function for afterLoginCallBack is the default one:

function afterLoginCallBack($data, $obj) { @session_start(); if (count($data)) { $_SESSION[“data”] = $data; } else{ //no record found so don’t redirect $obj->formRedirection(””); } }

The issue is that it does not redirect when I input the wrong username and password and then reintroduce them correctly again, meaning the formRedirection function becomes unresponsive. You can test it here: http://domustouch.com/meetings/log.php . I have to manually refresh the page so the script redirects me after I press the login button without any username/password mistakes prior to this action.

Hi,

It is because when user enters the wrong password then it reset the form redirection so you will need to set it again in before login callback function. Thanks

Superb, that worked fantastic! Thank you a lot for the suggestion. I will wait for your solution at question 2, hope that it’s not something too challenging :)

This example uses Googlemap (http://pdocrud.com/demo/pages/google-map) How can I use Openstreetmap (www.openstreetmap.org) in insertform? Thanks

Hi,

It has google map directly integrated.There is no direct support for Openstreetmap. If you need to add other maps then you need to use the callback function to add this. Thanks

Hello, there is an error exporting data to Excel, please tell me how to fix:

Notice:%20 Undefined offset: 26 in [MY_DOMAIN]/script/classes/PDOCrud.php on line 5511

Fatal error:%20 Uncaught PHPExcel_Exception: Invalid cell coordinate 1 in [MY_DOMAIN]/script/classes/library/PHPExcel/PHPExcel/Cell.php:594Stack trace:#0 [MY_DOMAIN]/script/classes/library/PHPExcel/PHPExcel/Worksheet.php(1218): PHPExcel_Cell::coordinateFromString(‘1’)#1 [MY_DOMAIN]/script/classes/library/PHPExcel/PHPExcel/Worksheet.php(1178): PHPExcel_Worksheet->createNewCell(‘1’)#2 [MY_DOMAIN]/script/classes/library/PHPExcel/PHPExcel/Worksheet.php(1085): PHPExcel_Worksheet->getCell(‘1’)#3 [MY_DOMAIN]/script/classes/PDOCrud.php(5511): PHPExcel_Worksheet->setCellValue(‘1’, ’...’)#4 [MY_DOMAIN]/script/classes/PDOCrud.php(3266): PDOCrud->arrayToExcel(Array)#5 [MY_DOMAIN]/scrip in [MY_DOMAIN]/script/classes/library/PHPExcel/PHPExcel/Cell.php on line 594

Hi

As per message, it seems that it is not able to find the cell. It may be due to too much data that is causing this error. Can you send us url to check it. Thanks

SQLSTATE23000: Integrity constraint violation: 1052 Column ‘user_id’ in where clause is ambiguous http://pdocrud.com/demo/pages/inner-join

I am getting the same error as your demo page above. I have this code: $crud->joinTable(“user_data”, “users.user_id = user_data.user_id”, “INNER JOIN”);

When I do a search and do not specify a field in the drop list https://www.screencast.com/t/ZSjGSAXEvW

I get the same error you do. SQLSTATE23000: Integrity constraint violation: 1052 Column ‘user_id’ in where clause is ambiguous

Please help.

Thank You,

Scott

Hi,

It is because user_id is same in both table, so you need to set column name as “user_data.user_id as userId” to make it working. Thanks

Thanks for the reply, are you suggesting changing the DB schema? Do you have a method for assigning the field ‘as’? Do you have an example of how to resolve this?

Thanks,

Scott

Hi,

You need to set the crudTableCol function without any ambiguous user_id column. $pdocrud->crudTableCol(array("first_name","last_name","meta_key"));

Thanks

Hi!! Do you know why my: input type=”submit”, inside forms, does not work (send my post variables to postback), when i put the line: echo $pdocrud->dbTable(“Clientes_Archivos”)->render(); ???

My form is like: form action= ”<?php echo $_SERVER[‘PHP_SELF’] ?>” method=”POST” so, i send the post variables to the same .php file

if i comment the line: echo $pdocrud->dbTable(“Clientes_Archivos”)->render(); i can retrieve my post variables like: if( isset($_POST[‘some_text’]) ){ but if i delete the comments, i can’t.

How can i still use my post variables fired with submit inputs, and also use this product?

I am installing the latest release of your app and I am seeing this error message:

Notice: Undefined index: i in /home1/edwardm3/public_html/costless/script/classes/templates/bootstrap/template-table.php on line 83

I looked at the file and it matches what was downloaded. I think I might have a problem with my folder configuration can you advise how to correct the issue?

Hi,

Is it possible to send access details via email to check as it’s not clear from code here. Thanks

Yes, to what email address shall I send the details?

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey