I am trying print the values from the DB on the HTML page generated in APPLICATION.rkt
but this is what i see when i execute the code below
&createstring;&db-conn;SELECT * from students
Here is what I am trying to execute:
#lang racket (require db) (require web-server/servlet) (provide/contract (start (request? . -> . response?))) (define db-conn (virtual-connection (lambda () (mysql-connect #:server "localhost" #:port 8889 #:database "SOB" #:user "root" #:password "root")))) (define (start request) (define (createstring id name sid) (string-append "id is " id "and name is " name "and sid is " sid)) (response/xexpr '(html (head (title "SOB")) (body ,@(map (h1) (map createstring (in-query db-conn "SELECT * from students")))) ))) (require web-server/servlet-env) (serve/servlet start #:launch-browser? #f #:quit? #f #:listen-ip #f #:port 8080 #:extra-files-paths (list (build-path "/Users/lalith/Documents/LALITH FILES/MDX/SOB/" "htmlfiles")) #:servlet-path "/servlets/APPLICATION.rkt")
Any suggestions as to what I'm doing wrnog?