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

ddeveloper

ddeveloper supports this item

Supported

732 comments found.

gce517

gce517 Purchased

I am already using Bootstrap 4.1.1 in my project and your script reloads bootstrap over it. Can this be avoided?

Hi

Yes, it can be done. You can create a new template folder by copying the bootstrap folder and in that remove css and js files. Also set its name in config file. It will work. Thanks

gce517

gce517 Purchased

Awesome, thanks!

ishemes

ishemes Purchased

It seems that the WHERE clause in my trigger is not being used. This is the trigger I added:

$pdocrud->setTriggerOperation(“products”, array(“user_id” => array(“type” => “fixed”, “val” => $user->id + 1)), array(“id” => array(“type” => “last_insert_id”, “operator” => ”=”)), “update”, “after_insert”);

The trigger is supposed to make sure a product that is added to the database will be linked to the currently logged in user. But every time I add a product ALL products in the database get linked to the current user.

Because the documents is not clear on how to add a where clause, I tried tweaking the where clause for about an hour before I dived into your code. And there in PDOModel I found the function:

function update($dbTableName, $updateData)

with two parameters, but it is being called with 3 parameters from PDOCrud.php in the function callbackTriggerOperation($data, $obj) .The third one being the where statement.

ishemes

ishemes Purchased

I’m working on the page layout and I have a few questions:

1. Is it possible to remove the first column with the row numbers from the table render? 2. Is it possible to remove the table footer which is the same as the table header? 3. How can I change the width of the forms? They are 100% width with no margin or padding.

Please forget aboutquestion #2. I found out I could remove the table footer with $pdocrud->setSettings(“footerRow”, false);

Hi

1. Yes, you can hide it using config settings.$config[“numberCol”] 2.Yes, you can hide it using config settings. $config[“footerRow”] 3. You need to add css for that.

Thanks

dhuerta29

dhuerta29 Purchased

is it possible to add callback to the columns of the table to insert html tags like: icons, bootstrap bottons etc?

Hi

It doesnt require callback functions. You can table Formatting function to achieve this. Please check this http://pdocrud.com/demo/pages/table-col-string-formatting

Thanks

dhuerta29

dhuerta29 Purchased

What I need is something that does this

column_callback (column, callable, path) – allows you to define custom layer for your column data.

$ xcrud-> column_callback (‘name’, ‘add_user_icon’); functions.php:

<? php function add_user_icon ($ value, $ fieldname, $ primary_key, $ row, $ xcrud) {     return ‘ ’. $ value; } ?>

Thank you

dhuerta29

dhuerta29 Purchased

What I need is something that does this

column_callback (column, callable, path) – allows you to define custom layer for your column data.

$ xcrud-> column_callback (‘name’, ‘add_user_icon’); functions.php:

<? php function add_user_icon ($ value, $ fieldname, $ primary_key, $ row, $ xcrud) {     return ‘ ’. $ value; } ?>

Thank you

Hi

I replied to your question in another thread. Please check. If it’s not clear, then let me know. Thanks

ishemes

ishemes Purchased

Is it possible to define different forms for Add and Edit actions? I would like to have a few fields in the Add form, but give possibility to change some other fields on Edit and not allow changes to some fields filled in in the Add form.

Hi

Currently, there is no option to make separate fields in add and edit in a single page but You can create separate pages for Add and edit to acheive this.

Thanks

Hello, can you help me out with following. I would like to use a form to collect data but prior adding to the Mysql database I would like to check if the user already exists or not, in order to avoid dupicate records.

Hi

There is no direct function available for this. You can use callback functions to check user exists or not. We have added this as a feature list for new version. Thanks

tiwale

tiwale Purchased

Morning, How can I use Joomla to authenticate users? This is what I used on external pages to get Joomla’s info

$mainframe = JFactory::getApplication(‘site’); $mainframe->initialise(); $user = JFactory::getUser(); $session = JFactory::getSession();

$user=$user->username;

Hi,

Joomla uses different way to authenticate user, it doesnt uses php session. You may be use Joomla session to set normal php session to make both work together.

Thanks

hey bro i ve just purchased and install your script i can not runnning it i just don t get how?? some help pls?

https://landing-page.e-e-e.co.il/form/

Hi,

You need to do some settings in config file. Please check http://pdocrud.com/documentation

After that you can create a php page and include script/pdocrud.php and run the code examples.

Also, to run demo, you can use demo sql file inside the demo folder to create database.

In case of still any doubt, please feel free to ask any question. Thanks

i need help pls contact via email

Hi

You can send email via profile page. Thanks

Is it possible to show the data from two columns in one single column, but format the data?

For example I have a column with a url in it and a column with name in it. I would like to show this in a column like this:

{$name-column}

Thank you for your time.

Hi

Please check http://pdocrud.com/demo/pages/table-col-more-formatting  $pdocrud->tableColFormatting("product_line", "html",array("type" =>"html",     "str"=>"<div style="font-weight:bold" data-attribute="abc-{col-name}">{col-name}</div>"));

Thanks

I tried this a few times with different variations, but the {col-name} tag always gets replaced by the value of the current column-cell. I can’t access the values of other fields, or at least I don’t know how.

Hi,

It shows value of current column only. You can create a new column by merging two columns. This 2 options are available currently. Thanks

There is a problem with the function formatTableData. It processes all the rules from tableDataFormatting(), but only outputs the last rule that was defined. This is caused by the inner loop in formatTableData that is processing all $rows for every $dataFormat, while storing the results in $output. Thus overwriting already processed output from previous loops. I fixed this by looping over all the $dataFormat for every $rows, instead of the other way around. But I’m not sure if this effects any other functionality in the code.

Is it possible for a beforeInsert callback function to return an error to the user in an Add form when they enter wrong data?

This shows a plain text error message on an empty white page. Is it possible to show the error message in the insert form? Perhaps with Javascript and Ajax calls?

Hi

All errors related to form are shown directly on focus out of field. If there is any php related error then it will show as error message on top. Let me know more details about error you want to show. Thanks

It looks like the error reporting is not working for me. For example, if you have a simple table with two integers. And you put a unique key on the two integers like this:

CREATE TABLE `test` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ALTER TABLE `test` ADD PRIMARY KEY (`a`,`b`); Then you keep adding items in the table with a standard pdocrud object: <?php require_once "includes/script/pdocrud.php"; ?> <head> <title>Test!</title> </head> <?php $pdocrud = new PDOCrud(); $pdocrud->dbTable("test"); echo $pdocrud->render(); ?>

When you try to add a record with numbers that are already in the database, the record is not added because a ‘Integrity constrain violation’ is being thrown. However, this is not shown when you press the save button. And when you press save and back you will get a white page with only this message:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-2' for key 'PRIMARY'

Anyway, besides this I would like to be able to throw an error in a before_insert callback function which then shows the error in the form in a nicely formatted way. Thank you for your time. This tool is a huge time saver.

by
by
by
by
by
by