Page 1 of 1

MySQL output/input Question

Posted: Thu Dec 12, 2013 4:36 pm
by DavJans
Hi everyone, I'm loving LiveCode so far, I cant wait till I know what I'm doing with it :)

I have followed this guide and it works great but not exactly what I would like:
/s/lessons/m/4071/l/7003-connecting-to-a-mysql-database

My question today is Inputting data / retrieving data from mysql automatically, here is my senario:

3 or more text entry fields are to be used, lets call the first one bucket, second collorSock and the third numberofsocks.

what I'm trying to do is, for example if i enter bucket1 and redsock, and there are none numberofsocks stays blank and I can enter the number there are. However if there are redsock's in bucket 1 I want the number to show in numberofsocks field as soon as the 2 first conditions are meet.

Is this possible, or will I need to add a button to push to query the server before I get my data?

Re: MySQL output/input Question

Posted: Fri Dec 13, 2013 6:52 am
by Simon
Hi DavJans,
Welcome to the forums, glad you are enjoying liveCode :)

Take a look at "textChanged" in the dictionary, you should be able to look up the data during that.
Or "enterInField" so that it only checks if after you have hit Enter in your second field.

This can be applied to your 3rd field to update the DB as well.

Simon

Re: MySQL output/input Question

Posted: Fri Dec 13, 2013 7:52 pm
by DavJans
Thank you
I tried this:

Code: Select all

on textChanged
 clear fld "field1"
end textChanged
Hoping to clear the text out of it however it deleted the field all together? got an easy one liner for me here?

Re: MySQL output/input Question

Posted: Fri Dec 13, 2013 7:56 pm
by DavJans
I fixed it using

Code: Select all

put "" into fld "field1"