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.

Thanks for a great program…

I am having a similar issue many others have posted about, but I am still not able to solve this. NOTE: I also have leftJoinData set to true in config.

$pdocrud = new \PDOCrud();
$pdocrud->setSettings("leftJoinData", true);
$pdocrud->fieldTypes("state_id", "select");
$pdocrud->fieldDataBinding("state_id", "states", "id", "name", "db");
echo $pdocrud->dbTable("sites")->render();

The view screen only shows site_id (integer) not the state name from the binding. It works fine in add/edit, but not in view.

Please advise.

Thanks

Scott

Hi,

It is saving “id” in the database so showing “id” at the view. If you want to save name directly, you can do that

$pdocrud->fieldDataBinding(“state_id”, “states”, “name”, “name”, “db”);

Thanks

Is this resolved the lost password that changed the password to all users?

Hi,

Yes, it is resolved in v 3.4. We will release it on Monday.Thanks

I was waiting for the update and it never arrived. What happened?

Hi Latest version is uploaded and approved. Please check. Thanks

Is the installation done as a normal plugin?

Hi Yes, you need enter some basic information in config. Php file. Please check below url for more details. http://pdocrud.com/documentation/#initialization_settings Thanks

I have updated pdocrud to the latest version. I’m trying to do a login page but I’m always getting “No records found” even when email and password are right. I think that the process is not going into beforeloginCallback function (I put an alert inside and it is not shown). This is the code:

pdocrud.php:

<?php @session_start(); /*enable this for development purpose */ ini_set('display_startup_errors', 1); ini_set('display_errors', 1); error_reporting(-1); date_default_timezone_set(@date_default_timezone_get()); define('PDOCrudABSPATH', dirname(__FILE__) . '/'); require_once PDOCrudABSPATH . "config/config.php"; spl_autoload_register('pdocrudAutoLoad'); function pdocrudAutoLoad($class) { if (file_exists(PDOCrudABSPATH . "classes/" . $class . ".php")) require_once PDOCrudABSPATH . "classes/" . $class . ".php"; } if (isset($_REQUEST["pdocrud_instance"])) { $fomplusajax = new PDOCrudAjaxCtrl(); $fomplusajax->handleRequest(); } //example of how to add action function function beforeloginCallback($data, $obj) { //do something like if your passwords are md5 encrypted then change the value $data["usuarios"]["pwd"] = md5($data["usuarios"]["pwd"]); return $data; } function afterLoginCallBack($data, $obj) { @session_start(); if (count($data)) { //save data in session $_SESSION["data"] = $data; } else{ //no record found so don't redirect $obj->formRedirection(""); } }

and detail.php:

<?php require_once 'script/pdocrud.php'; ?> <!DOCTYPE html> <head><meta http-equiv="Content-Type" content="text/html; charset=gb18030"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="bpa.css"> </head> <?php $pdo_crud = new PDOCrud(); if ($pdo_crud->checkUserSession("user_type",array("0","1","2"))) { if(isset($_GET['f']) && intval($_GET['f'])) { // Cogemos el parámetro función para saber qué grupo de funciones es $f_id = intval($_GET['f']); $pdocrud = new PDOCrud(false, "pure", "pure"); ------- MY OWN CODE ------- } else { echo '<center><img src="img/Logo.png" width="400px" /></center> '; //Login page code $pdo_crud->addCallback("before_select", "beforeloginCallback"); $pdo_crud->addCallback("after_select", "afterLoginCallBack"); $pdo_crud->formFields(array("email", "pwd")); $pdo_crud->setUserSession("user_type", "user_type"); $pdo_crud->formRedirection("detail.php?f=1", true); echo $pdo_crud->dbTable("usuarios")->render("selectform"); echo "<a href="detail.php?f=11" target="contentframe">Forgot password</a>"; } ?>

Do you see the error?

Thank you.

Hi, any idea? Thanks

Hi

We have checked at our end. It is working properly as last version. Can you please send access to check it at your end. Thanks

Ok, resolved.

Hi, is there a possibility for a callback after export? I would like to mark a row as exported, after excel export. I guess the answer will be no… so if there is no built in possibility, where could I place such a function?

Thanks in advance, best regards – BL

Hi,

You can add $data = $this->handleCallback(‘after_export’, $data); in exportTableData() function.

We will also add it in next version. Thanks

great product!! very adaptable and loaded with features.

I am new to php and sql and your script makes things easier and strangly helped me understand and grasp a lot about both.

I have project where wanting a “timestamp” when user adds and/or updates a record… after trial an error I get results in form field to show current “timestamp” but when form “save” or “save and back” is submitted, the table and database gives 0000-00-00 00:00:00. I have tried setting database to datetime, timestamp with upon update current timestamp etc with no success. I have tried using variable to only get errors. could you please try to explain how to accomplish this with example? if it even possible with your script

thank you

Ok. I will wait for your message. Thanks

ddeveloper,

I figured out my issue… the database was setting default to 0000-00-00 00:00:00 I manually set to CUREENT TIMESTAMP and it is working now thank you so very much!! again I love this product and will review your other products and look for new ones by you. being as new to php and sql, I am sure to run into more questions but I am confident to receive helpful support, at least if I pose the question right…lol again thank you

HI,

Ok great. Thanks a lot for your positive review. It inspires us add more new feature to make it best. We are always ready to help. Let me know if have any issue in future also. Thanks

Is there an example of how a form can be used to send the entered data to the subscriber and to an admin email and of course store the data to a mysql db?

Is it also possible to add some php code after the saving of the data to another mysql db on a remote server via a api. I have the api already written just need the data from the variable to populate the api fields.

Thank

Hi

Please provide purchase code to help you further as it is not visible with your name label. Thanks

I was trying to ask before purchasing. I purchased the product. Is it possible to get the answers now. Thank you.

Do you have a support site different from this one, also?

Hi Ok. Yes. Please check following demo for email data. http://pdocrud.com/demo/pages/send-email-using-pdocrud

For the other api, you can get data easily using PDOModel object and Pass it to api. Thanks

this view of the modal window has an error when deleting multiple data a modal is loaded with the same table and the data is not deleted until the page is reloaded, please correct it, here the error captures

https://danielhuerta.cl/img_clinica/popuperror1.png https://danielhuerta.cl/img_clinica/popuperror2.png

Hi

Ok. I will check it and correct it if required. Thanks

Thank you so much indeed for the new update. I am very happy with the new function “Check duplicate records”. Would be posible to have some example how to redirect to page if true and not to redirect if is false? In addition, there is a bug with date field when they choose it sets incorrect date in some cases. I have a print screens for you, just tell me how to send it to you.

Hi

Surely, we will try to add this feature. I have added it in list. You can send screens via email (digidreamstech@gmail.com) .Thanks

I’m using postgres 10x and it’s not generating the add and edit forms. What can it be?

Hi,

Is it showing some kind of error in php or js? Please check console or share url, we will check it. Thanks

Hello there-

I purchased this product earlier today. I have a question. I created a second PDOCrud instance, using one of my own databases. I had to change much code like this: echo $pdocrud->dbTable(“employees”)->render(); I’m asking if all new tables will have to be corrected like this. Also interested if my new copy of pdocrud – is this right? Don Brady, yoriknme@gmail.com

Hi,

Sorry, I am not able to understand your question. Please provide more details. Thanks

Hello, I still have the problem of validation on checkboxes (in the process of validation, an error appears that asks you to select all), I quote the code:

$ pdocrud-> fieldTypes (“skills”, “checkbox”); $ pdocrud-> fieldDataBinding (“skills”, array (“Strategy” => “Strategy”, “Communication” => “Communication”, “Technology” => “Technology”, “eCommerce” => “eCommerce”, “Performance ”=>” Performance ”,” Digital Factory ”=>” Digital Factory ”,” Data ”=>” Data ”,” Play ”=>” Play “),” ”,” ”,” array “);

After this I wanted to ask if it is possible to search using the FULLTEXT function?

Hi

Your code seems correct.please provide url to check it. Regarding FULLTEXT, no it doesn’t support explicitly full text currently. Thanks

So I have two tables that I joined:

User Table Col_ID Col_Name Col_RoleID

Role Table Col_ID Col_Name

The value I display on the Col_RoleID is binded on the Col_Name from the Role Table. Everything is fine, until I add new record.

When I add new record, instead of saving all the records to the user table (which is the main table), the Col_RoleID is blank and the data saves instead to the Col_ID from the Role Table which I intend to use only for display during joined table.

Any function that you might have to solve it? Thanks!

P.S. Tables and columns are for sample only to demonstrate the issue.

Hi

Please share your code to understand the issue. Thanks

I have joined two tables and want to display a column with 3 values separated by comma from another table using field binding. Instead of displaying the value of 1, 5, 6 which are the primary keys from other table, I want to display the name. I have successfully binded it using the code on your documentation page however it only display the first value.

Can you please give an example of source code for it? Please don’t point me to your documentation page since I have scoured everything on it. I’m not that good in PDO as well, so a sample code will help. Thank you!

Hi

Since it is multiple comma separate value from the other table so we can’t use LEFT join or INNER join. One option is to use query to display data but please note that in query option it doesn’t have action buttons. Please check below example for query https://stackoverflow.com/questions/19101550/mysql-join-two-tables-with-comma-separated-values

Other option is to format data using the callback function. You need to call function to get data for each value in callback function.

Please check and let me know if it works for you. Thanks

$result = mysqli_query(mysqli_connect(“localhost”, “root”, ””, “ministry”), “SELECT ministry from users”);

while($row = mysqli_fetch_array($result)){
    $myString = $row['ministry'];
    $myArray = explode(',', $myString);
    if (!isset($myArray[1])) { $myArray[1] = null; }
    if (!isset($myArray[2])) { $myArray[2] = null; }
    if (!isset($myArray[0])) { $myArray[0] = null; }
for ($k = 0 ; $k <=2; $k++){
    $id = $myArray[$k];
    $ministry = mysqli_fetch_array(mysqli_query(mysqli_connect("localhost", "root", "", "ministry"), "SELECT ministry_name from ministry WHERE id = '$id'"));
    $mname[$k] = $ministry['ministry_name'];
}
$arr = array($mname[0], $mname[1], $mname[2]);
$currency = implode(", ", $arr);
echo $currency;
}

I did it this way. But i don’t know how to connect the value of the fields in this query. My guess is, I have to replace the first line and instead of selecting everything, I’m gonna select the value per field. Moreover, change the echo to put the value to the column.

I have a suggestion for the next update I would like that by adding this code that appears in the following image the file input maintains the preview of the image

https://danielhuerta.cl/img_clinica/imagen.png

Hi,

Ok. I will try to add in future version. Thanks

Is there a function that hides the delete button for certain data?

there is some way to reload this section marked with ajax from pdocrud

https://danielhuerta.cl/img_clinica/clinica.PNG

HI

I am not sure about what you are asking, as this is fixed image and lable. You want to load it via ajax? on which event? Let me know.

if it is with ajax but using session php variables

Is it possible to integrate with payment supplements such as paypal or webpay?

Hi

You can implement and integrate payment gateway using your code. This is basically a crud app so doesn’t have direct feature for this. Thanks

can you send me sample, pdocrud with codeigniter 3 integrated?

Hi,

It’s not possible to provide codeigniter 3 integrated code. All you need to do is put it in helper and call it from main files. Thanks

I just upgraded to the latest release. Demo code wouldn’t display anything in the Actions column and pagination wouldn’t work. I found this in line 15 of the config file:

$config[“script_url”] = “http://localhost:81/pdocrud/”;

Got rid of the reference to port 81 and all is well now.

Hi

yes, you need to enter your config script_url. It was ours. Though we have released again with no port to avoid confusion. Thanks

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