Search found 108 matches

by maverickalex
Tue Apr 05, 2011 9:33 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: How to select the highest value.
Replies: 4
Views: 3924

Re: How to select the highest value.

Thanks Dunbarx, i used the first example and adjusted it to put the txt file into the variable.

Thanks again for your help.

Alex
by maverickalex
Mon Apr 04, 2011 12:13 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: How to select the highest value.
Replies: 4
Views: 3924

Re: How to select the highest value.

Hi Dixie, my apolgies. the post isnt overly clear. The fuel line (line 4) is the only line which contains the fuel data in the six line chunk. the six values you see are repeated every second, so in the example the next fuel figure is line 10 then line 16. the other values are not connected. in shor...
by maverickalex
Mon Apr 04, 2011 11:00 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: How to select the highest value.
Replies: 4
Views: 3924

How to select the highest value.

Hi, I have a file that my app grabs info from. The file is newline delimited and has just 6 lines. however these are updated every second, so the same lines are continued thousands of times. An excerpt. AVA001 EDDF EDDB fuel 19717.886719 240.741669 CRJ-900 AVA001 EDDF EDDB fuel 19716.490234 241.6750...
by maverickalex
Tue Mar 29, 2011 3:57 pm
Forum: Databases
Topic: using last_insert_id() from mySQL in Rev
Replies: 2
Views: 4054

Re: using last_insert_id() from mySQL in Rev

Actually, by trial and error i managed to do this although i think its not the correct way. i first executed the first insert which sent the auto incremented row to the table phpvms_pireps. Then a second execute like so put "select last_insert_id ( ) from phpvms_pireps" into tpirepid put revDataFrom...
by maverickalex
Tue Mar 29, 2011 2:56 pm
Forum: Databases
Topic: using last_insert_id() from mySQL in Rev
Replies: 2
Views: 4054

using last_insert_id() from mySQL in Rev

i have had a lot of success now completing my app in rev using mysql databases. My final stumbling block prior to finishing is using the LAST_INSERT_ID() function in conjunction with rev. In short my table pireps has incrementing rows for each insert. my insert looks like so:(shortened) put "INSERT ...
by maverickalex
Sun Mar 27, 2011 5:04 am
Forum: Databases
Topic: Using Random number as a percentage
Replies: 6
Views: 5619

Re: Using Random number as a percentage

I found the cause and it was as i suspected. Load is a reserved word in MYSQL. In order to use it in a table or column name it needs to be surrounded by back ticks `load`.

Alex
by maverickalex
Sat Mar 26, 2011 9:04 am
Forum: Databases
Topic: Using Random number as a percentage
Replies: 6
Views: 5619

Re: Using Random number as a percentage

ok, i have tried to simplify things to identify why load wont work as a variable tload i created a new stack which just puts a single field into the variable tload then inserts it into the db put field "load" into tload put "INSERT INTO phpvms_load (load) VALUES ('"&tload&"')" into tdata revExecuteS...
by maverickalex
Fri Mar 25, 2011 9:14 pm
Forum: Databases
Topic: Using Random number as a percentage
Replies: 6
Views: 5619

Re: Using Random number as a percentage

Bernd,

Thank-You ever so much for that. really made my day getting that part to work.

Now to try and trace why field "load" anf variable tload wont work.

Cheers
Alex
by maverickalex
Fri Mar 25, 2011 9:37 am
Forum: Databases
Topic: Using Random number as a percentage
Replies: 6
Views: 5619

Re: Using Random number as a percentage

Thanks Bernd

I had seen that in the dictionary but couldn't figure out where or how to implement it.
I noticed an example using random elsewhere which is where i got the current script from.

could you show an example on how to use that function.

Thanks
by maverickalex
Fri Mar 25, 2011 7:30 am
Forum: Databases
Topic: Using Random number as a percentage
Replies: 6
Views: 5619

Using Random number as a percentage

Firstly, I am trying to generate a random number between two known number. My script grabs an aircraft type from a database and i am trying to use the IF command like so. --generate the passenger numbers for each aircraft type trying to generate random passenger count (approx 80% capacity) for each ...
by maverickalex
Mon Mar 21, 2011 11:02 am
Forum: Databases
Topic: Struggling with RevQuery
Replies: 2
Views: 3416

Re: Struggling with RevQuery

Thanks Jan, I finally managed to get it to work as intended using this (pretty simple) put "SELECT rank from phpvms_pilots where pilotid='"&tpilotid&"'" into tpilotrank put revDataFromQuery(comma,return,gConnectionID,tpilotrank) into trankdata put trankdata into field "rankdata" I succesfully used t...
by maverickalex
Wed Mar 16, 2011 6:53 pm
Forum: Databases
Topic: Struggling with RevQuery
Replies: 2
Views: 3416

Struggling with RevQuery

I have a number of tables in mysql database. I am trying to do a select from query. I have a variable tpilotid which contains a number from 1 - 1000 and corresponds with a column in a table called pilots. what i'm trying to achieve is this. if tpilotid = a value from the pilots column then select th...
by maverickalex
Wed Mar 09, 2011 3:29 pm
Forum: Databases
Topic: MYSQL syntax error
Replies: 18
Views: 14026

Re: MYSQL syntax error

For some reason i couldnt get the variable tload to work, but changed it to tpass and it worked fine. I have moved on a good way now. i have run into a part that leaves me scratching my head a little. i have a field where the text is hilited and is a list of some 100 flighnumbers. it is populated by...
by maverickalex
Sat Mar 05, 2011 10:34 pm
Forum: Databases
Topic: MYSQL syntax error
Replies: 18
Views: 14026

Re: MYSQL syntax error

Thanks, i'm sorry if it seems a PITA, i actually had it earlier (except i had the single quotes inside the doubles). I have succesfully connected and sent to the database, thanks for your help. i truly do appreciate it. I understand how frustrating it can get when you feel like you are banging your ...
by maverickalex
Sat Mar 05, 2011 7:33 am
Forum: Databases
Topic: MYSQL syntax error
Replies: 18
Views: 14026

Re: MYSQL syntax error

SUCCESS! well partial. this put "INSERT INTO phpvms_test (aircraft,flightnum,depicao,arricao,flighttime,fuelused,comments) VALUES ("& 'tAircraft' & "," & 'tFlightnum' & "," & 'tDepicao' & "," & 'tArricao' & "," & 'tflighttime' & "," & 'tfuelused' & "," & 'tComments' &")" into tSQL successfully sends...