Home  >  Q&A  >  body text

medoo return value problem

20190726105437.png


QQ图片20190726105547.png




#This update operation returns the number of rows in the result $data and $data->rowCount(); what is the difference? Aren’t they both returning influence functions?


In addition: medoo update operation,

Update successful:

If the data changes, return the number of rows $data=1

If the data does not change, the number of rows returned $data=0;

Update failure:

The number of rows returned $data is also 0. How to make if judgment, update failure and update success ( (data has not changed) the return value is the same, how to write the judgment

红色熊猫红色熊猫1912 days ago1146

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2019-07-26 14:12:11

    update() performs an update operation, then the affected record stored in $data is not a PDO object;

    rowCound() should be called on the pdo object;


    Please check the $data type, var_dump() or gettype()

    reply
    0
  • Cancelreply