All pastes #553365 Raw Edit

spf + mysql

public text v1 · immutable
·published 2007-06-09 18:02 UTC
rendered paste body
\ \ * ForthUNE * mySQL module *

REQUIRE "              ~ac/lib/str4.f
REQUIRE {              ~ac/lib/locals.f
REQUIRE MyQuery  ~day/lib/mysql.f
REQUIRE /STRING lib/include/string.f

: selectValueJivevcard_String1
        S' SELECT value FROM jivevcard WHERE username="'
;
: endS
        S' "'
;

: querer { muc id | myH myRes val }
   S" localhost" S" root" S" " MyConnect ABORT" NO DB!"
   TO myH

   S" wildfire" myH MySelectDB 0= ABORT" can't select db"

   id STR@ " {selectValueJivevcard_String1}{s}{endS}" STR@
   2DUP CR TYPE
   myH MyQuery 0=  ABORT" Can't make query"

   myH MyStoreRes TO myRes
   0 myRes MyFetchRow
   CR
   myRes ColData
   2 .SN
   TYPE SPACE
   myRes MyFreeRes
   myH MyClose
;

: test
  " mary"
  " john"
  querer
  " betty"
  " jim"
  querer
;

test