Dbi.Mysql using parameters error - beginner simple problem
peggymark <[email protected]> Wed, 21 Sep 2005 09:56:32 +0530
| Newsgroups | gmane.lisp.allegro |
|---|---|
| Message-ID | <[email protected]> |
Dear Friends,
First Thanks for taking your valuable time.
quick look so you don't have to read the whole email if it is an
obvious error-
The error message is as follows: Error: Illegal keyword given: Mark.
[condition type: program error]
this function gives the previous error.
(defun get-user (db first second)
(sql " format nil select UserName, Pwd from Login where UserName =
'~a' and Pwd = '~a'"
first second
:db db)
(mysql-insert-id db))
I call the function this way: (get-user db 'Mark 'Peg)
The error message is as follows: Error: Illegal keyword given: Mark.
[condition type: program error]
Any resources for code examples or documentation on using dbi.mysql??
I have Allegro CL installed in my Linux Machine and have tried to use
Allegro Serve with MySQL to create a web application. All is going ok so
far but... (ha ha) Here is my problem, I have two functions one for
inserting and one for looking up a login user through MySQL. The insert
works but the lookup won't accept my parameters for the select statement.
Here are the two functions with the function calls i make to lisp in
emacs. Can you see where the problem is?? i use dbi.mysql and put in
this function call (setq db (connect :user "markandeya" :password
"service" :database "CallMaint")).
this connects me to my Mysql database and is working.
this function works
(defun add-user (db first second)
(sql (format nil "insert into Login (UserName, Pwd) values('~a','~a')"
first second
:db db))
(mysql-insert-id db))
i call the function this way: (add-user db 'Mark 'Peg)
this function gives errors
(defun get-user (db first second)
(sql " format nil select UserName, Pwd from Login where UserName =
'~a' and Pwd = '~a'"
first second
:db db)
(mysql-insert-id db))
I call the function this way: (get-user db 'Mark 'Peg)
The error message is as follows: Error: Illegal keyword given: Mark.
[condition type: program error]
Thank you for any help or suggestions on database programming through Mysql.
Markandeya