mysql_affected_row return 0 ???

From: Bob Bedford (bedford1_at_notforspammershotmail.com)
Date: 02/28/05


Date: Mon, 28 Feb 2005 09:33:14 +0100

I've this code:

 if(mysql_query("delete from emails where email = '$email'",$mydatabase)){
  if(mysql_affected_rows()>0)
    echo('successfull');

This code seems ok, but even if the query works fine (the email line is
deleted from the mysql database), the mysql_affected_rows is 0

My config: XP, apache, PHP 4.3.10, mysql 4.1.10

What's wrong with my code ?



Relevant Pages

  • have to "actions" or run two types of queries (select,and update) on the same form?
    ... my mysql database. ... query will run as well as when the select query is run (select button ... could use another php page for update, but I am guessing this can be ... global $dbconnect, $query; ...
    (comp.lang.php)
  • Re: function does not return
    ... Some servers will put slashes on returning data, ... The exception to this is if you called addslashes() before you inserted the data in the MySQL database. ... The ifstatement probably made sense years ago, before the query was assigned the line before. ...
    (alt.php)
  • Re: Why does the word "Array" show on a select query
    ... > MySQL database which is working fine except prior to displaying the table ... > with the results from the select query it displays 1 line for each row in ... > Following is the PHP code for constructing the table from the results ...
    (comp.lang.php)
  • Why does the word "Array" show on a select query
    ... I am new to php and MySQL and I'm attempting to run a select query on a ... MySQL database which is working fine except prior to displaying the table ... Following is the PHP code for constructing the table from the results ...
    (comp.lang.php)
  • Re: How do mysql_fetch_assoc/mysql_query work?
    ... When I submit a query using PHP I ... at least the data I want) in an array. ... I submit a query to a MySQL database it goes away, ... What language are you using? ...
    (comp.lang.php)