ddeveloper

ddeveloper supports this item

Supported

65 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.

hrisafis

hrisafis Purchased

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

adanny1

adanny1 Purchased

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

adanny1

adanny1 Purchased

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?

adanny1

adanny1 Purchased

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

adanny1

adanny1 Purchased

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

by
by
by
by
by
by