Professional Web Applications Themes

UPDATE query appears to complete but nothing changes in data (php/mysql) - MySQL

Greetings: I have an UPDATE query (php 5.1.6/mysql 5.0.24a on apache 2.2) that appears to execute with no errors (php,mysql, or apache) but the data in the "UPDATEd" table doesn't change. I've checked privileges for connecting account and that isn't an issue. The UPDATE count even increments in the mysql logs. Maybe it's my query: $editO = " UPDATE organization SET orgname = '$name', office = '$off', address1 = '$add1', address2 = '$add2', city = '$city', state = '$state', country = '$country', zip = '$ZIP', phone1 = '$phone1', phone2 = '$phone2', fax = '$fax', email = '$email', website = '$website', ...

  1. #1

    Default UPDATE query appears to complete but nothing changes in data (php/mysql)

    Greetings:

    I have an UPDATE query (php 5.1.6/mysql 5.0.24a on apache 2.2) that
    appears to execute with no errors (php,mysql, or apache) but the data in
    the "UPDATEd" table doesn't change. I've checked privileges for
    connecting account and that isn't an issue. The UPDATE count even
    increments in the mysql logs. Maybe it's my query:

    $editO = "
    UPDATE organization
    SET
    orgname = '$name',
    office = '$off',
    address1 = '$add1',
    address2 = '$add2',
    city = '$city',
    state = '$state',
    country = '$country',
    zip = '$ZIP',
    phone1 = '$phone1',
    phone2 = '$phone2',
    fax = '$fax',
    email = '$email',
    website = '$website',
    notes = '$notes',
    lasteditdate = '$lastedit',
    publish = '$pub',
    updatedby = '$uname'
    WHERE org_id = '$orgid'";

    include_once 'dsn.php';
    $res=mysql_query($editO)
    or die('Query Failed: ' . mysql_error());

    I've shuffled it around to get rid of whitespace to no effect. Any
    advice is appreciated.

    --

    Regards,

    Jeff Gardner
    ___________________________

    "Contrary to popular belief, Unix is user friendly. It just happens
    to be very selective about who its friends are." --Kyle Hearn
    Jeff Guest

  2. #2

    Default Re: UPDATE query appears to complete but nothing changes in data(php/mysql)

    Jeff Gardner wrote: 

    Is org_id a string or a numeric value? If the latter, you shouldn't
    have quotes around $orgid.

    What does mysql_affected_rows return?

    Note that not updating any rows (i.e a mismatch in the org_id) is not an
    error. It just means that no rows matched your WHERE clause.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  3. #3

    Default Re: UPDATE query appears to complete but nothing changes in data(php/mysql)

    Jerry Stuckle wrote: 
    >
    > Is org_id a string or a numeric value? If the latter, you shouldn't
    > have quotes around $orgid.
    >
    > What does mysql_affected_rows return?
    >
    > Note that not updating any rows (i.e a mismatch in the org_id) is not an
    > error. It just means that no rows matched your WHERE clause.
    >[/ref]
    Thanks, Jerry. "$orgid" was indeed the problem.

    --

    Regards,

    Jeff Gardner
    ___________________________

    "Contrary to popular belief, Unix is user friendly. It just happens
    to be very selective about who its friends are." --Kyle Hearn
    Jeff Guest

Similar Threads

  1. flash > php > mySQL update query problem
    By kidfunctional in forum Macromedia Flash Data Integration
    Replies: 1
    Last Post: April 20th, 03:39 PM
  2. #26327 [Opn->Bgs]:  appears in Mysql DB
    By alan_k@php.net in forum PHP Development
    Replies: 0
    Last Post: November 20th, 02:25 AM
  3. #26327 [NEW]:  appears in Mysql DB
    By mjsnetzko at worldbizhosting dot com in forum PHP Development
    Replies: 0
    Last Post: November 20th, 02:07 AM
  4. problem with a mysql query with data from a form
    By Vincent Fievet in forum PHP Development
    Replies: 3
    Last Post: August 29th, 01:15 PM
  5. Can't complete Windows Update
    By Dave Mitchell in forum Windows XP/2000/ME
    Replies: 1
    Last Post: July 17th, 12:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139