Back to the month index |
Back to the list index
|
Brock Hankus (brock@cs1.sxu.edu)
Wed, 12 Nov 1997 09:35:43 -0600
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- Next message: Pop Qvarnström: "Re: bug in acl parsing in msql2.0.3"
- Previous message: Daniel A. Christenson: "mSQL Support for groups?"
Message-ID: <3469CCCF.4E37A145@cs1.sxu.edu> Date: Wed, 12 Nov 1997 09:35:43 -0600 From: Brock Hankus <brock@cs1.sxu.edu> Subject: Re: W3-msql problem doing insertI had the same problem, and here is the response that I got. It worked
perfectly.
Probably your msql.acl entries for the database allow a read to everyone
for that database, but not a write. Try to find out, under which User
Name CGI processes are started (for example in my university it's
wwwexec). You can do this by calling some CGI skript from your browser
with somestrangename that contains a sleep command.
Then you can 'ps -ef |grep somestrangename' from an xterm and take a
look at the user.
Insert this user for write access in your msql.acl.
The Unix file access rights should be good, if the user that is running
the msql2d demon has write rights on the database and the table.
If you have tables that you want to allow a write on and some that you
want to protect, you should put them into different databases (at least
if you don't have to do joins between them, and if you don't know who
might write CGI-scripts, like here in university, but I think I am quite
safe with this (force_private also helps)).
This worked for me.
Gregor Gramlich
Brock Hankus wrote:
...
> I am trying to insert data from a html form into the database using
> w3-msql.
> I can connect to the database and select the database with no problems,
> however when I try to insert
> data I get the error message : "access to database denied". This is my
> code for the insert function:
>
> $empquery = "insert into employer values( " +
> "'$empseq','$organization','$street','$city','$state'," +
> "'$zip','$phone','$fax','$email','$url')";
> if (msqlQuery($sock, $empquery) < 0)
> {
> echo("Insert into employer failed : $ERRMSG\n");
> }
....
> Brock Hankus
> brock@cs1.sxu.edu
William Quay wrote:
> Hi Everyone,
>
> I am new to mSQL & w3-msql, so please excuse me if some of these
> questions are not-too-bright. I will learn!
>
> The doc my ISP has made available is a bit sketchy, so perhaps that is
> the problem, too...
>
> Here's my immediate problem/question:
>
> I can set up web-based forms to query my database(s), but get an error
> (ERROR : Access Denied)
> when I try to do an update.
>
> It seems like this is a privileges problem? My msql.acl looks like this:
>
> # Enable read & write for everyone, but only local
> database=*
> read=*
> write=*
> access=local
> host=*
> # test above
>
> # For any other database, I let only myself read and write them:
> # database=*
> # read=*
> # write=websavvy
> # access=local
> # host=*
> # the above seems to work for read access, but not for web updates
>
> The w3-msql code looks like this:
>
> <!
> $sock = msqlConnect("localhost");
> if ($sock < 0)
> {
> echo("Error : $ERRMSG\n");
> }
> if (msqlSelectDB($sock, "areacodes") < 0)
> {
> fatal("Error : $ERRMSG\n");
> }
>
> if (msqlQuery($sock, "insert into areacodes values
> (999,'999','999','9')") < 0)
> {
> echo("ERROR : $ERRMSG\n");
> }
> else
> {
> echo("<B>success</B>\n");
> }
> >
>
> Guidance, anyone?
>
> TIA!
>
> Bill Quay
- Next message: Pop Qvarnström: "Re: bug in acl parsing in msql2.0.3"
- Previous message: Daniel A. Christenson: "mSQL Support for groups?"