more SQL problems

docmann docmann at gmail.com
Wed Dec 29 11:09:01 EST 2004


Hello folks,
I've been trying to resolve a problem on my own off and on for several
days and just can't seem to get my head wrapped around it all. Even
worse, now with so many attempts and errors under my belt, I have
finally reached the point of almost total confusion. :(

Let's say that I have a MySQL database named "quickref"
The 3 records in my table look something like this:
--------------------------
|  City  |  State | Zip  | --*City is the primary key

  Houston   Texas   74239

  Portland  Oregon  32791

  Dallas    Texas   75217
--------------------------

dbID is the ID returned when the connection is established

revField1 is named "myCity" --used to display record content
revField2 is named "myState" --used to display record content
revField3 is named "myZip" --used to display record content

revField4 is named "CurrSQL" and contains "SELECT * FROM quickref WHERE City ="
revField5 is named "mySearch" and contains "Portland"

I have no problems connecting to the database and returning the dbID
and all I want to do is display the contents of a record in each of
three fields based on the name of the city entered into the "mySearch"
field.

RevButton Named "Search"
on mouseUp
  put field "CurrSQL" into tSQLStringPartOne
  put field "mySearch" into tSQLStringPartTwo
  put tSQLStringPartOne & " " & tSQLStringPartTwo into tSQLQuery

  get revDataFromQuery(,,dbID,tSQLQuery,"tMyResults")

end mouseUp


I've tried using an almost endless number of
"revDatabaseColumnNamed()" combinations trying to extract the data,
without luck.  Although there may still be more than one problem in my
scripting, I *think* that the issue is in the way I'm trying to use
the revDatabaseColumnNamed() function which I don't fully understand.

Based on the info shown, can someone please show me how to properly
get the record set into variables so I can display them in the
appropriate fields on my stack?

I'd really appreciate any help or advise.

-Doc-


More information about the use-livecode mailing list