MySQL output/input Question

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

MySQL output/input Question

Post by DavJans » Thu Dec 12, 2013 4:36 pm

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?
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: MySQL output/input Question

Post by Simon » Fri Dec 13, 2013 6:52 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Re: MySQL output/input Question

Post by DavJans » Fri Dec 13, 2013 7:52 pm

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?
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Re: MySQL output/input Question

Post by DavJans » Fri Dec 13, 2013 7:56 pm

I fixed it using

Code: Select all

put "" into fld "field1"
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

Post Reply