Mailing List Archive



Back to the month index Back to the list index

abbott on 9th Street (jabbott@wolf.co.net)
Mon, 14 Apr 1997 19:31:27 -0500


Date: Mon, 14 Apr 1997 19:31:27 -0500
Message-Id: <199704150031.TAA25613@wolf.co.net>
From: abbott on 9th Street <jabbott@wolf.co.net>
Subject: [mSQL] conceptual problem that needs to be overcome

OK, I am a newbie. I admit it. I have been working with mSQL for close to
24 hours now.

I installed mSQL - pretty smooth. Not many troubles at all on a FreeBSD
machine. What I have been able to do so far is this adaptation of the
bookmark database. mSQL seems to be working just great. It is about a 30x
improvement over the flat file database that I had been using.

The MPCA Employee Database</i></H1>
<!
        $sock = msqlConnect();
        if ($sock < 0)
        {
                fatal("Error : $ERRMSG\n");
        }
        if (msqlSelectDB($sock,"aimeetest") < 0)
        {
                fatal("Error : $ERRMSG\n");
        }
>
<center>
<!
        if (msqlQuery($sock,"select * from employee where first clike 'john'" +
                " order by last") < 0)
        {
                fatal("Error : $ERRMSG\n");
        }
        $res = msqlStoreResult();
        $row = msqlFetchRow($res);
        printf("<table border=0 cellspacing=10><tr>");
        while (#$row > 0)
        {
            printf("<td>%s</td><td>%s</td><td>%s</td><td><a
href=\"mailto:%s\">%s<
/a></td><td>%s</td>",$row[1], $row[0], $row[2], $row[3], $row[3], $row[4]);
            printf("</tr>\n");
            $row = msqlFetchRow($res);
        }
        printf("</table>");
        msqlFreeResult($res);
>

The way this is working is that I have the SQL stuff hard coded into the
html page. Where I am stuck is now trying to figure out how to make is so that

<FORM ACTION="???????????????" METHOD="POST">
<PRE>
Last Name: <INPUT TYPE="text" NAME="last" SIZE=40>
First Name: <INPUT TYPE="text" NAME="first" SIZE=40>
Department: <INPUT TYPE="text" NAME="dept" SIZE=40>
E-mail Address: <INPUT TYPE="text" NAME="email" SIZE=40>
Phone Number: <INPUT TYPE="text" NAME="phone" SIZE=40>
</PRE>
<INPUT TYPE="submit" VALUE="Submit the search">

Can accept the input and form the SQL. What I have done so far, don't
laugh, is make the form action point to a perl script that will parse out
the name value pairs build an html page with the sql still hard coded in and
then point the browser location to this file.

I have this feeling that I am *really* going about this the long hard way
but I feel like the faq and the manual both fall off just after you get mSQL
installed and running and then does not pick up again until you get into
some really complex stuff.

Any suggestions, examples would be very much appreciated!

Advance thanks.
--ja

--------------------------------------------------------------------------
To remove yourself from the Mini SQL mailing list send a message containing
"unsubscribe" to "unsubscribe" to msql-list-request@bunyip.com. Send a message containing
"info msql-list" to majordomo@bunyip.com for info on monthly archives of
the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!