Code

Discussion on PDOModel - Database abstraction and helper PHP class

Discussion on PDOModel - Database abstraction and helper PHP class

Cart 247 sales

ddeveloper supports this item

Supported

125 comments found.

Hi, I purchased your RestpAPI and I have a problem. I have database on another server than app. In the config file I set correct login and db server information but if I call GET request I always get 404 status.

The API folder I copied in the root my app page (https://ucto.hlavaty.online/api).

In the ISS parameter in config file I inserted https://ucto.hlavaty.online – is this correct? Can you help me pleas?

Thanks! Jiri

Hi

We have replied to your other similar msg. Please check. Thanks

Can you give me an example code as it would be with ajax please?

Hi

It would be like any other Ajax code. You need to create a php page and write this script code you want to use there. Now call this page using Ajax.

Thanks

Great product… very helpful!

I have a simple question. How can I query for a null value (check if datetime is null in Mysql)?

I tried: $value = null; $pdomodel->where(“datemodified”, $value); $result = $pdomodel->select(“employees”);

Regards

Michel

Hi Will This work whit php 7.x?

Hi,

Yes, this works for php 7.x Thanks

Hello,

I like your script. but how to check the results. For example:

$insertEmpData[“firstName”] = “Simon”; $insertEmpData[“lastName”] = “jason”; $result = $pdomodel->insert(“emp”, $insertEmpData);

if($result){ //if not any errors or $result == true etc., echo “Done!”; } else{ echo “Error!” .$error; }

My purchase code: ce582b20-fe70-4095-ab3a-865df6947a71

Best regards, Batdelger

Hi, I have a error when insert and update record Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /home3/bataa84/mrops/app/libs/PDOModel.php on line 880. Could you help me?

Hi, I have a error when insert and update record Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /home3/bataa84/mrops/app/libs/PDOModel.php on line 880. Could you help me?

Hi

This is already resolved in the latest version. Please download latest version from here. Also your support is expired. Please renew it. Thanks

Hi,

is it possible to support ‘attach’ to make Joins over 2 Databases?

Thanks alot

Hi,

Sorry it’s not possible to use “attach” keyword with join. Thanks

does this use ajax?

Is it possible to integrate it with ajax?

Can you give me an example code as it would be with ajax please?

Hi We have replied to your question. Please check. Thanks

Hello,

i have a question. Can i Crud in MS Sql Server 2017 with your script?

thanks kaplan

Hi

Yes, we do support MS SQL Connection and it works for SQL Server 2017. You need to enable the pdo sql server extension to make it work.

Thanks

Hello,

do you support MS SQL Connection?

Thanks E. Kaplan

Hi

Yes, we do support MS SQL Connection and it works for SQL Server 2017. You need to enable the pdo sql server extension to make it work.

Thanks

Hi,

a very nice script. But I have problems with the export.

During the PDF creation the following error is output: Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in http-Path\script\library\tcpdf\tcpdf.php on line 17573 TCPDF ERROR: Some data has already been output, can't send PDF file By the Excel output, the file is created. But only the following error message is displayed in the Excel file: Fatal error: 'break' not in the 'loop' or 'switch' context in http-Path\script\library\PHPExcel\PHPExcel\Calculation\Functions.php on line 576

best regards Titio24

Hi,

You can try to hide the warning message using the error_reporting(0);

It may be due to the older version of tcpdf, you can replace it with latest version. We will release a new version also.

Thanks

Hi, When I write “error_reporting(0);”, the error “Fatal error: ‘break’ not in the ‘loop’ or ‘switch’ context in http-Path\script\library\PHPExcel\PHPExcel\Calculation\Functions.php on line 576” is no longer displayed in the Excel file, but the Excel file is complete empty.

Hi,

Is it possible to send details to check at your end? You can send the details via email using profile page. Thanks

I would like to insert a record and give a function as a value for a field. For example:

INSERT INTO table_name (name, timestamp) VALUES ('Example', NOW());

How can I give NOW() as a parameter using $pdomodel->insert()?

Hi,

please send message via product you purchased. You dont need to provide licence code then. Thanks

Hi,

In case you are using the database related values like “now()” then instead of insert query function, you need to use the executeQuery function and pass the now value directly.

Thanks

Thank you for your response!

Hi will you change phpexcel to phpspreadsheet in future versions?

Hi,

Yes, we will surely upgrade it. It’s already on future plan list. Thanks

GREAT!!! Do you have any estimated date (aprox)?

Hi

We can’t give exact date but we will try to add it as soon as possible. Also, please purchase your support as it’s expired. Thanks

Hi,
It is possible to add columns names as table headers (thead) in the HTML Export Options.
Thanks!

Hi,

Currently it export without column header. You can use the array format to generate HTML as required. Thanks

Hello, Really enjoy using PDOModel but have a question. Any assistance would be greatly appreciated. I absolutely love the simplicity of executeQuery so…

Is there a way to insert LIMIT parameters using prepared statements with executeQuery? In the code below inserting the parameters by including $limit and $offset directly into the query works but doesn’t work in the commented out line which attempts to use ? placeholders and an array.

$limit = $_GET[“limit”]; $offset = $_GET[“offset”]; $pdomodel = new PDOModel(); $pdomodel->connect($servername, $username, $password, $dbname); $records = $pdomodel->executeQuery(“SELECT * FROM Products ORDER BY ProductName ASC LIMIT $offset,$limit”); //$records = $pdomodel->executeQuery(“SELECT * FROM Products ORDER BY ProductName ASC LIMIT ?,?”, array($offset,$limit)); $json=$pdomodel->arrayToJson($records);

Thanks Rob

Hi,

Limit parameters currently are passed directly as it is, we will check if i’ts possible to pass it as parameter or not.Thanks

Hi,

I bought your “PDO Crud” script: what are the differences between “PDO Crud” and “PDOModel”?

Thanks.

Best Regards, Matteo

Hi,

PDOModel is for database abstraction class means it helps to perform database operation without writing sql queries. while PDOCrud helps you build forms directly from database as well as display of data. PDOCrud is build on top of the pdomodel so it has all major functions of pdomodel as well.

Thanks

Hello, i recently purchased PDOModel and am super-impressed. Is there an example of using executeQuery() with multiple parameters? I really want to take advantage of this incredible time-saving function but also want to use placeholders in queries using incoming form variables in order to mitigate sql injection issues. Thanks!

/execute sql/ $result = $pdomodel->executeQuery(“select * from emp where empId = ?”, array(39));

Hi,

Thanks for your super fast response. Based on this info I created the following which works perfectly…

$CustCity = $_GET[“CustCity”]; $CustState = $_GET[“CustState”]; $CustAreaCode = $_GET[“CustAreaCode”]; $pdomodel = new PDOModel(); $pdomodel->connect($Server, $User, $UserPassword, $Database); $records = $pdomodel->executeQuery(“select CustFirstName, CustLastName from customers WHERE CustCity = ? and CustState = ? and CustAreaCode = ?”, array($CustCity,$CustState,$CustAreaCode)); $json=$pdomodel->arrayToJson($records); print_r($json);

...which makes the executeQuery function 100% Nobel Prize-worthy.

Just to make sure I am understanding this correctly, any type of query that I execute with executeQuery using the prepared statement with bound parameters, ? placeholders method outlined above should be injection-proof.

If that is correct you really have to tell people about this. It’s a real game changer.

Thanks!!!

Hi,

Yes, as you can see that parameters are not directly passed in query, instead they are passed during execute query function. Please check below url. We have used the same method.

http://php.net/manual/en/pdo.prepare.php

Thanks

Hi,

Thanks for verifying. The ability to take existing, complex queries and, with very little editing, execute them using injection-safe prepared statements in such a simple way is really, really extraordinary.

Top work!

Hi, your script is great. Could you tell me what this update includes?

Hi,

We have added insert on duplicate update statement. It’s also mentioned in description as well as in readme file. Thanks

So, PDOCrud does contains pdoModel?

Well, the answer is YES, I just read that in PDOcrud.. Thanks!

Hi,

Yes, you have read absolutely correct. It contains PDOModel as well.

Please check example of using PDOModel in PDOCRUD.

http://pdocrud.com/demo/pages/raw-data-operations

PDOCrud does many more things, Please check all examples here

http://pdocrud.com/demo/pages/

Thanks

Hello! Your script is great, the following is happening to me, when I use the excelToArray option and in my excel I have a data like this: 1650E412 when importing the class converts that data automatically to INF.00E + 00 …. you know how I can avoid it? Thank you.

Hi,

It is not script, it is excel that is converting it. You can set format of column in excel to display as actual string. Thanks

Hi. Thank you. Yes, that’s a solution.

and helper function to upload files?

Yes i liked that one too but i don’t have option on how to display data, I only see table, what is i want to display like a card blog post produt etc… i see only tables.

Hi

You can get data in form of array and display as you want. PDOModel also present in PDOCrud so you have all functionality of PDOModel. There are various options to present data and you can also modify it as per your requirement.

Thanks

Hello I bought your script and will start working now with it, just one question i see in the script has thoise two variable $fileUploadPath $fileSavePath, i need to upload 1 file or multiple files, that’s the only functionality i think the script don’t have, can you help me please on it, to add those function/method?

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