Code

Discussion on PDOModel - Database abstraction and helper PHP class

ddeveloper

ddeveloper supports this item

Supported

68 comments found.

How do I perform a Update if Exist, Else Insert

Hi,

You need to use executeQuery function for this. Thanks

rowsChanged always return 0 when doing a batch update.

Hi

For both point, I will check once again and send you updated file if required. Thanks.

Any news regarding the rowsChanged issue?

Hi

We have rechecked it. The suggestion given by us is working fine. I have tried to update 4 rows and it has shown 4 rows changed result. Please make sure to change following code in updatebatch function. $this->rowsChanged += $stmt->rowCount();

In case of still issue, let me know. I will resend you complete file. Thanks

Went to use the INSERT functionality to update product and price listings however could not find syntax for equivalent of INSERT …. ON DUPLICATE KEY UPDATE price… Which demo or file can syntax be seen?

Hi

You need to use executeQuery function for this operation.

Thanks

The documentation refers to fetchAll() in the introduction. When I run that example the error message back from PHP is “PHP Fatal error: Call to a member function fetchAll() on a non-object ” even though inserting an echo before the fetchAll() confirms 1 record found. Grepping the supplied code returns no occurrence of fetchAll() function except in the documentation introduction example. Need more info please?

The code sample taken from the documentation introduction with echos added is… $DBLINK->where(“PRODID” , $zpid ); $result = $DBLINK->select(“wlxprod”); $ztest=$DBLINK->totalRows; // the # of inv items in db .. 0 if none found ... increment counter and put odd string in the html for manual edit echo $ztest; // returns a 1 which is the correct number of items while($row = $result->fetchAll()) { echo $row[‘PRODID’]; echo $row[‘PRICE1’]; }

Hi

I have replied to your same question in other thread. Thanks

The documentation refers to fetchAll() in the introduction. When I run that example the error message back from PHP is “PHP Fatal error: Call to a member function fetchAll() on a non-object ” even though inserting an echo before the fetchAll() confirms 1 record found. Grepping the supplied code returns no occurrence of fetchAll() function except in the documentation introduction example. Need more info please? The code sample taken from the documentation introduction with echos added is… $DBLINK->where(“PRODID” , $zpid ); $result = $DBLINK->select(“wlxprod”); $ztest=$DBLINK->totalRows; /* the # of inv items in db .. 0 if none found … increment counter and put odd string in the html for manual edit/ echo $ztest; / returns a 1 which is the correct number of items */ while($row = $result->fetchAll()) { echo $row[‘PRODID’]; echo $row[‘PRICE1’]; }

Hi

You don’t need to call fetchall function. It returns data in format of array. You can loop through the array data using the foreach function.

Thanks

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?

MWNS

MWNS Purchased

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

MWNS

MWNS Purchased

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

hi PDOModel simple do database related operation only while PDOCrud generates display of data and insert/edit form as well. There are many more features in PDOCrud, please check demo to understand it well. Thanks

by
by
by
by
by
by