MySql database for app iOS and Android

Creating desktop or client-server database solutions?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

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

Re: MySql database for app iOS and Android

Post by Simon » Tue May 19, 2015 8:47 pm

And i think this i will need when i will use one dataGrid.
Nope, I don't think so.
Your revDataFromQuery will return just a number (if your sql is correct) and you must run what is returned through ConvertSQLCursorToArray.
Sure your data will be returned in an array but easy to work with "combine".

This is the only dataGrid specific line

Code: Select all

set the dgData of group "DataGrid 1" to theDataGridArray
Ignore it and just work with the array.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: MySql database for app iOS and Android

Post by aebki » Tue May 19, 2015 8:58 pm

Thanks Simon,

I will test it a little bit later.

I hope i will manage and it will work! :-)

Regards.

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: MySql database for app iOS and Android

Post by aebki » Wed May 20, 2015 9:46 am

Hi,

This morning i tried it and it worked...So now i am able to connect to the database and also to make one select.
But only from the desktop! :-( If i try in the simulator it is not working.:-(
What i made wrong or which thing i forgot to put in my code?

This is my code:

Code: Select all

on openCard
   put CmpExist("aebki") into numb
   answer numb
   if stayLoginChecked is 1 then
      set the hilite of btn "ChkStayLogin" of card "cardLogin" to true
      set the icon of the btn "ChkStayLogin" of card "cardLogin" to the id of image "StayLoginChecked.png"
      go to card "cardAccess"
   else
      set the hilite of btn "ChkStayLogin" of card "cardLogin" to false
      set the icon of the btn "ChkStayLogin" of card "cardLogin" to the id of image "StayLoginUnchecked.png"
   end if
   
end openCard

function CmpExist theUser

   databaseConnect
   put "SELECT psd FROM Members WHERE MyName = " & "'" & theUser  & "'" into query
   put revDataFromQuery(tab,return,tDatabaseID,query) into myPsd
   answer "result " & myPsd

end CmpExist

Regards.

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: MySql database for app iOS and Android

Post by aebki » Wed May 20, 2015 11:34 am

Hi,

Any idea why it is only working in the desktop version?
How it should be to make it work in the simulator, and of course in one real device iOS / Android?

I don't know what i have to do to make it work in the simulator.
And here there is nothing to do with any special folder as the database is online, no???

Regards.

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: MySql database for app iOS and Android

Post by aebki » Wed May 20, 2015 2:02 pm

Hi,

Please, i need help to advance. I am blocked here and i am not able to see why it is working only in desktop and not in the simulator.

Thanks in advance!

Regards.

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: MySql database for app iOS and Android

Post by aebki » Wed May 20, 2015 7:39 pm

Hi,

Any one of the great coders of this forum ( Klaus, Simon, Sefro, Jacque, Dave, etc.) can tell me what i am doing wrong in my code?
Because i can access to the database online (on-rev server) and make one Sql Select only in the desktop version. But what it interests me is to access from iOS and Android to this database.

Regards.

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

Re: MySql database for app iOS and Android

Post by Simon » Wed May 20, 2015 8:03 pm

Hi aebki,
Do you have Mysql selected in the standalone settings for mobile?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: MySql database for app iOS and Android

Post by aebki » Wed May 20, 2015 8:57 pm

Hi Simon,

Thanks a lot for you answer! :-)
It was exactly this!!! I was thinking that was something much more complicated...But in fact was easier than what i thought...

Once again thanks a lot for your help!!! :-)

Regards.

ronniebellie
Posts: 28
Joined: Fri Jun 26, 2015 6:17 pm

Re: MySql database for app iOS and Android

Post by ronniebellie » Sat Jun 27, 2015 6:03 pm

I'm a new comer to Livecode and have spent the last 4 days figuring out how to connect my Livecode app to a MySQL database and then display some of the results of that data in a Livecode data grid. I'm working on an educational conference (2 days long) that will be held in October of this year with about 800 attendees. There will be about 200 presentations and workshops. The presentation info is in a MySQL database and includes info such as name, institution, presentation title, presentations summary, biography, intended audience, topics addressed, etc.

I am having some success. The database connection is working fine. I am able to show certain data fields (short ones such as first name, last name, presentation title, room and time) in columns in a datagrid. Unfortunately, with the longer fields such as presentation summary, the info in the column does not wrap and it's one long horizontal line of about 35 words. What I want to do now is take it to the next step and be able to click on a presentation title in the data grid and and then for it to show more info about that particular presentation on another card such as presentation summary, biography, audience, topics addressed, etc. I don't even know where to begin with such a task.

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 833
Joined: Fri Aug 15, 2008 7:15 am

Re: MySql database for app iOS and Android

Post by bangkok » Sun Jun 28, 2015 6:11 am

ronniebellie wrote: What I want to do now is take it to the next step and be able to click on a presentation title in the data grid and and then for it to show more info about that particular presentation on another card such as presentation summary, biography, audience, topics addressed, etc. I don't even know where to begin with such a task.
You would need a "datagrid form".

Here is a lesson that shows how to handle variable text height.

http://lessons.runrev.com/m/datagrid/l/ ... ne-heights


cd

Post Reply

Return to “Databases”