Page 2 of 2

Re: MySql database for app iOS and Android

Posted: Tue May 19, 2015 8:47 pm
by Simon
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

Re: MySql database for app iOS and Android

Posted: Tue May 19, 2015 8:58 pm
by aebki
Thanks Simon,

I will test it a little bit later.

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

Regards.

Re: MySql database for app iOS and Android

Posted: Wed May 20, 2015 9:46 am
by aebki
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.

Re: MySql database for app iOS and Android

Posted: Wed May 20, 2015 11:34 am
by aebki
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.

Re: MySql database for app iOS and Android

Posted: Wed May 20, 2015 2:02 pm
by aebki
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.

Re: MySql database for app iOS and Android

Posted: Wed May 20, 2015 7:39 pm
by aebki
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.

Re: MySql database for app iOS and Android

Posted: Wed May 20, 2015 8:03 pm
by Simon
Hi aebki,
Do you have Mysql selected in the standalone settings for mobile?

Simon

Re: MySql database for app iOS and Android

Posted: Wed May 20, 2015 8:57 pm
by aebki
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.

Re: MySql database for app iOS and Android

Posted: Sat Jun 27, 2015 6:03 pm
by ronniebellie
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.

Re: MySql database for app iOS and Android

Posted: Sun Jun 28, 2015 6:11 am
by bangkok
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