Professional Web Applications Themes

Insert fails on access that I know works... - PHP Development

Folks, I use PHP to write my form data to MySQL. I have a database with about ten tables. I'm trying to fill one table with some dummy data (its a contact manager table holding names of people, addresses and whatever but I'm createing random values for the moment). The insert fails telling me that access is denied - however I use the exact same username/password/database name/host name on the other tables, and the insert and updates work just fine. I know this sounds odd - but is there any other reason as to why I might get the access ...

  1. #1

    Default Insert fails on access that I know works...


    Folks,

    I use PHP to write my form data to MySQL.

    I have a database with about ten tables. I'm trying to fill one table with
    some dummy data (its a contact manager table holding names of people,
    addresses and whatever but I'm createing random values for the moment). The
    insert fails telling me that access is denied - however I use the exact same
    username/password/database name/host name on the other tables, and the
    insert and updates work just fine.

    I know this sounds odd - but is there any other reason as to why I might get
    the access denied message, other than what I assume should be just for an
    invalid username/password?

    The following is a customized output of my error:

    Query failed
    Error Number 1044
    Message: Access denied for user: 'localhost' to database 'myDatabase'
    Comments:INSERT INTO myDatabase.contactManager (title, firstname, initial,
    lastname, position, publisherHash, salutation, company, county, teldd,
    telfax, telddext, division, telsb, telsbext, telcell, telpager, telother,
    address1, address2, city, postcode, country, email, website, type) VALUES
    ("Ms", "Morpheus", "W", "YlastnameVFRE", "Partner",
    "d98fb3d2476eaa8da3957481e0946109", "Dear Morpheus", "KcompanyQSJV",
    "BcountyLJSW", "251-823-1450", "251-479-4495", "35", "Vancouver",
    "251-682-5043", "883", "604-587-3284", "423-435-8301", "423-734-9771",
    "Apartment 777 - 9431 North Way", "South Coquitlam", "Nanaimo", "Q22E14",
    "CA", "bttgxyphn.net", "www.gxyphn.net", "1")

    HOST= 192.168.1.2
    USER= myUser
    PASSWORD= myPassword
    NAME= myDatabase
    TABLE= contactManager

    Can anyone suggest one area that I could look at to help fix the problem?
    Pleaseeeeeee...

    many thanks,
    randelld


    Randell D. Guest

  2. #2

    Default Re: Insert fails on access that I know works...

    Randell D. <you.can.email.me.at.randelld> wrote:
    > I have a database with about ten tables. I'm trying to fill one table with
    > some dummy data (its a contact manager table holding names of people,
    > addresses and whatever but I'm createing random values for the moment). The
    > insert fails telling me that access is denied - however I use the exact same
    > username/password/database name/host name on the other tables, and the
    > insert and updates work just fine.
    So you might have a permission problem, apparantly yhe user doens't have
    insert priveliges...
    > I know this sounds odd - but is there any other reason as to why I might get
    > the access denied message, other than what I assume should be just for an
    > invalid username/password?
    On the mysql site they have a whole page about this:
    [url]http://www.mysql.com/doc/en/Access_denied.html[/url]

    --

    Daniel Tryba

    Daniel Tryba Guest

  3. #3

    Default Re: Insert fails on access that I know works...


    "Daniel Tryba" <news_comp.lang.phpcanopus.nl> wrote in message
    news:bnn2gm$e7s$2news.tue.nl...
    > Randell D. <you.can.email.me.at.randelld> wrote:
    > > I have a database with about ten tables. I'm trying to fill one table
    with
    > > some dummy data (its a contact manager table holding names of people,
    > > addresses and whatever but I'm createing random values for the moment).
    The
    > > insert fails telling me that access is denied - however I use the exact
    same
    > > username/password/database name/host name on the other tables, and the
    > > insert and updates work just fine.
    >
    > So you might have a permission problem, apparantly yhe user doens't have
    > insert priveliges...
    >
    > > I know this sounds odd - but is there any other reason as to why I might
    get
    > > the access denied message, other than what I assume should be just for
    an
    > > invalid username/password?
    >
    > On the mysql site they have a whole page about this:
    > [url]http://www.mysql.com/doc/en/Access_denied.html[/url]
    >
    > --
    >
    > Daniel Tryba
    >
    Thanks for pointing me to the doentation - but it didn't help me (though
    it might do in the future).

    The user does have insert privilages - I had mentioned this earlier in my
    post saying the same username and password worked for a different table in
    the same database on the same server...

    I think though I have solved it - Strangely, even though the message did
    point to access being denied, I believe the problem related to a column in
    the table that was suppoed to be unique, wasn't.

    I have a unique hash created for each record - I discovered that even after
    seeding a new random number sequence, the same md5 hash was created every
    time... I've changed the code and unique hashes are created everytime now,
    and the records seem to be writing just fine. So far, I've written four or
    five thousand records...

    Thanks for the prompt reply though...


    Randell D. Guest

  4. #4

    Default Re: Insert fails on access that I know works...

    Randell D. <you.can.email.me.at.randelld> wrote:
    >> On the mysql site they have a whole page about this:
    >> [url]http://www.mysql.com/doc/en/Access_denied.html[/url]
    >
    > Thanks for pointing me to the doentation - but it didn't help me (though
    > it might do in the future).
    >
    > The user does have insert privilages - I had mentioned this earlier in my
    > post saying the same username and password worked for a different table in
    > the same database on the same server...
    Hmmmm, I forgot that access in mysql is per database and not per table
    :)
    > I think though I have solved it - Strangely, even though the message did
    > point to access being denied, I believe the problem related to a column in
    > the table that was suppoed to be unique, wasn't.
    >
    > I have a unique hash created for each record - I discovered that even after
    > seeding a new random number sequence, the same md5 hash was created every
    > time... I've changed the code and unique hashes are created everytime now,
    > and the records seem to be writing just fine. So far, I've written four or
    > five thousand records...
    Funny, normaly a more approriate error would occur (at least that is my
    experience).

    --

    Daniel Tryba

    Daniel Tryba Guest

  5. #5

    Default Re: Insert fails on access that I know works...


    "Daniel Tryba" <news_comp.lang.phpcanopus.nl> wrote in message
    news:bnnalu$g7t$1news.tue.nl...
    > Randell D. <you.can.email.me.at.randelld> wrote:
    > >> On the mysql site they have a whole page about this:
    > >> [url]http://www.mysql.com/doc/en/Access_denied.html[/url]
    > >
    > > Thanks for pointing me to the doentation - but it didn't help me
    (though
    > > it might do in the future).
    > >
    > > The user does have insert privilages - I had mentioned this earlier in
    my
    > > post saying the same username and password worked for a different table
    in
    > > the same database on the same server...
    >
    > Hmmmm, I forgot that access in mysql is per database and not per table
    > :)
    >
    > > I think though I have solved it - Strangely, even though the message did
    > > point to access being denied, I believe the problem related to a column
    in
    > > the table that was suppoed to be unique, wasn't.
    > >
    > > I have a unique hash created for each record - I discovered that even
    after
    > > seeding a new random number sequence, the same md5 hash was created
    every
    > > time... I've changed the code and unique hashes are created everytime
    now,
    > > and the records seem to be writing just fine. So far, I've written four
    or
    > > five thousand records...
    >
    > Funny, normaly a more approriate error would occur (at least that is my
    > experience).
    >
    > --
    >
    > Daniel Tryba
    >
    I would agree - I though would think its more likely I unknowingly fixed
    more than one bug in my script than an error in MySQL...

    Thanks for the help though...


    Randell D. Guest

Similar Threads

  1. Update fails on CF 7.0, works on CF 5.0
    By jdeline in forum Coldfusion Database Access
    Replies: 3
    Last Post: April 17th, 03:08 PM
  2. CF_SQL_BIT works on Insert, not on Update
    By DennisBelmont in forum Coldfusion Database Access
    Replies: 3
    Last Post: October 4th, 07:47 PM
  3. IsPlaying() works on one SWF and fails on another?
    By aa in forum Macromedia Flash
    Replies: 0
    Last Post: October 25th, 08:19 AM
  4. DVD insert works but not in projector
    By oxenburgh in forum Macromedia Director Basics
    Replies: 0
    Last Post: February 15th, 03:24 PM
  5. VPN works on dial-up but fails through LAN
    By Tom in forum Windows Networking
    Replies: 2
    Last Post: July 1st, 11:25 PM

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