Re: Bizarre Problem Involving EuSQL

new topic     » goto parent     » topic index » view thread      » older message » newer message

Instead of being able to use this:

data = {1,"Name","Text","12.12.2004","12:15",2,1}
sql = sprintf("SELECT COUNT(*) FROM ENTRIES WHERE (JOURNAL_ID=%d) AND
    (ENTRY_NAME='%s') AND (ENTRY_TEXT='%s') AND (ENTRY_DATE='%s') AND
    (ENTRY_TIME='%s') AND (AUTHOR_ID=%d) AND (PRAYER_ID=%d)",data)


(the above kept saying "not enough values for sprintf), I had to use this:

sql = "SELECT COUNT(*) FROM ENTRIES WHERE (JOURNAL_ID=" &
   sprintf("%d",{data[1]}) & ") "
sql &= "AND (ENTRY_NAME='" & data[2] & "') AND (ENTRY_TEXT='" &
   data[3] & "') "
sql &= "AND (ENTRY_DATE='" & data[4] & "') AND (ENTRY_TIME='" &
   data[5] & "') AND (AUTHOR_ID=" & sprintf("%d",{data[6]}) & ")
   AND (PRAYER_ID=" & sprintf("%d",{data[7]}) & ")"


-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu