LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

need help for "From concatenate string insert to mysql table"

I still think you can't use "Date" or "Time" as column names; try putting them in square brackets, too.  I'd rename the columns if it was my database.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 11 of 27
(1,596 Views)

 ic, thanks jim. i will change the columns' name to try it out. Jim i have a questions. My value data of Date, Time, and Wind Speed are logged and get the output from concatenate string. as pic below

 

untitled.JPGThe output of the concatenate string would be Date[Tab]Time[Tab]Wind Speed , can i also store the value of Date into 1 variable like a, data of Time into 1 variable like b, and data of  Wind speed into 1 variable like c. den i can just INSERT INTO wind_speed_data ( column1,column2,column3 ) VALUES ( a, b, c) . is tis can method works?

 

My program is log wind speed data every 1 minute, and write it into a text file. this part is done, but im requested to save the logged data into mysql database too instead of text file only. im stuck at tis part @.@... 

0 Kudos
Message 12 of 27
(1,586 Views)

You need to wire the values you put into your concatenate string to the inputs of the format into string. At the moment you have controls so it will insert the data from the controls on your front panel ('Date', 'Time', 'Wind Speed').

 

At the moment your controls are empty so you are writing empty data.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 13 of 27
(1,570 Views)

Like this.   By the way, why are you adding zero to your wind speed?

 

snip.jpg

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 14 of 27
(1,555 Views)

Thanks sam and jim. I will gv it a try ! Jim, its a formula given by my teacher. Have to 4lo. 😞

0 Kudos
Message 15 of 27
(1,528 Views)

Now my connection is as below. 

 

New Picture (5).JPG

 

And it shows tis thing out. DateTime Error.

New Picture (5sssssd).JPG

 

I change my column in mysql to A B C first to try out... ( A - Date, B - Time, C - Wind Speed)

dfssdfdsfsdf.JPG

0 Kudos
Message 16 of 27
(1,503 Views)

You need to format the datetime into a valid string to insert into the database that it understands. Try something like YYYY/MM/DD HH:MM:SS (it might be '-' instead of '/').

 

The clue is in the error message.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 17 of 27
(1,477 Views)

ok noted.! thanks you sam 😄

0 Kudos
Message 18 of 27
(1,471 Views)
A, B and C for column names? Are you kidding us? How about something descriptive like test_date or sample_time? Do you give names to your VIs like that?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 19 of 27
(1,438 Views)

@mikeporter wrote:
Do you give names to your VIs like that?

Mike...

Mine are named Untitled 1.vi, Untitled 2.vi ... Untitled 33.vi Smiley Tongue

Message 20 of 27
(1,416 Views)