Menu

Delete Error...

Help
2011-03-04
2012-06-07
  • Christopher Cooley

    Hello,

    It seems I've done something that is causing the following error when I try to
    delete a contact from within the contacts details:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
    resource in /home/content/89/7462689/html/cms/delete.php on line 14

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
    resource in /home/content/89/7462689/html/cms/include/address.class.php on
    line 18

    The record deletes ok if I place a check next to it from the main page. Any
    clues on where I should look first?

     
  • Christopher Cooley

    Oh, and I'm using the latest version.

     
  • Christopher Cooley

    Ok, after researching and echoing code I discovered on or around line 390 in
    dbconnect.php, it had the following:

    $part_sql = $table."id = '$id'";

    I changed it to:

    $part_sql = $id;

    And it works. Is this an error in the code or is it still something I did?

     
  • chatelao

    chatelao - 2011-03-05

    Hi, this is an error in the code and should already be fixed in the most
    recent version.

    Thanks for helping O., hope you stay with PHP-Addressbook

     
  • Christopher Cooley

    I was wrong, don't do what I posted on step 3 above. This will delete the
    entire database.

    Instead where it says:

    $part_sql = $table."id = '$id'";

    just add a period before id:

    $part_sql = $table.".id = '$id'";

    Without the period, the MySQL syntax is wrong and generates an incorrect value
    for MYSQL_NUM_ROWS.

     
  • chatelao

    chatelao - 2011-03-11

    Hi CrCool,

    Just download the most recent release. This should fix the bug too.

    Regards O.

     

Log in to post a comment.