0

A simple mysqli Query:

$DoNukePrefsDBC = "DELETE FROM DB_DiaryOfAnApp.ACTVxCJAR WHERE REVxGUIDxREF = '$IdxZero' LIMIT 1";

Variable $IdxZero may or may not have a valid value in that, the ROW may or may not exist.

When it does not, the Query executes and fails silently.

But, I set up a DELETE using a value : {99fa39e9-4f79-4045-8adc-905ca1283c8e} for a ROW which I KNOW does not exist and put it to the mysql console ::

mysql> DELETE FROM DB_DiaryOfAnApp.ACTVxCJAR WHERE REVxGUIDxREF = '{99fa39e9-4f79-4045-8adc-905ca1283c8e}' LIMIT 1; Query OK, 0 rows affected (0.00 sec)

My question is this: is there a way to capture [[[ Query OK, 0 rows affected (0.00 sec) ]]] in a php variable, in my script?

Edit: Ah, some good jumping off points in the answer this question was marked as a duplicate of:

mysqli_affected_rows() mysqli_info()

MountainMan
  • 753
  • 2
  • 10
  • 20
  • https://www.php.net/manual/en/function.exec.php – AbraCadaver Jun 03 '21 at 02:27
  • @AbraCadaver Hunh. Yes, I can see that would be a fit tool. Definitely can code something up off that. Is it the case that this is pretty much the only option? This question got *closed* in a right hurry. Can't vote up a comment but for you, lol. Thx. – MountainMan Jun 03 '21 at 02:43
  • PHP functions wont give you that text if that's what you need. – AbraCadaver Jun 03 '21 at 03:15
  • Yeap, was hoping there was some obscure built~in; but between exec or some kludgy test if row exists before the query I can work around it. :) – MountainMan Jun 03 '21 at 03:20

0 Answers0