-1

I could ignore this but would rather find out why it not acting as I imagine.

I have this query:

$updateQuery = $mysqli->query(
    "UPDATE `enquiries`
    SET `customer_id` = '$customer_id'
    WHERE `email` = '$email'"
) or die('Error:'.mysql_error());

After this query I simply echo out

 echo "Query Complete";

The query is only part of a longer script, before I added this query the Query Complete message was echoed out.

After adding this query nothing was shown. So I added the:

or die('Error:'.mysql_error());

To debug but it simply shows 'Error:' and not any errors. My question is that the query itself actually runs fine, and updates the rows as neeeded but it kills the script still.

Where am I going wrong with this? Thanks.

Lovelock
  • 7,179
  • 17
  • 79
  • 177

1 Answers1

2

You're mixing up mysql and mysqli, which obviously won't work, in your case you were looking for mysqli_error but even then it won't work because you use the object-oriented interface.

Use $mysqli->error to access the last error string, as described in the documentation.