Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    May 2007
    Posts
    162
    Thanks
    13
    Thanked 0 Times in 0 Posts

    compare two tables or a better way?

    I'm writing a Perl CGI program that inputs perishable data into mysql. It's basically a form that all has to do with the same study, but in order for me to get the data I need, it seems like I need to write two different forms/scripts to take the morning data and place it into a table before the data is lost, and then the evening data and place into another table...then relate the two tables, or combine them. Is there a way I could run two scripts at different times during the day and input the data into one row with the same primary key(1 day=1 row so the date with be the primary key) of the table? What's the best way? Let me know if my question's not making sense and I can clarify.
    Thanks,
    Shad

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,631
    Thanks
    4
    Thanked 147 Times in 138 Posts
    please clarify with example data what you are trying to achieve.

  • #3
    Regular Coder
    Join Date
    May 2007
    Posts
    162
    Thanks
    13
    Thanked 0 Times in 0 Posts
    I've attached the HTML code I'm using for the form. I've been manually inputting the data, but am going to automate most of it through Perl, and then I'll use the prepare statement to pass the params and parsed data to mysql.
    Basically, I want to have a record of this weather data once a day/one set of data per day on one row preferable, so I can formulate statistics about objective data (parsed) and some subjective data (user input). I'm comfortable with inserting the data into mysql via Perl as I've done that with a different program.
    So, I have some data (only objective so maybe I can just run this first script automatically as scheduled task) that I'd like to/need input to mysql around 11AM daily because some of the data gets erased from the web later in the day.
    Objective data: Date, FCLI, FCMUCAPE, FCPW, 12LI, 12MUCAPE, 12PW

    The rest of the data I'll need to enter around 8pm:
    Subjective data:TS, CVG, RER, TROF, CCFP, NOTES
    Objective data: 00LI, 00MUCAPE, 00PW, GRAD

    I haven't written the perl code for inputting the data into mysql yet as I'm trying to get the concept of how to run two scripts but enter into the same row on mysql(thus my forum post) and also I'm still working on the parsing scripts for the objective data.

    So maybe I'll have to get further along in the perl/mysql coding before you can help me out. My main question is how will the second script know to place the second set of data in the same row as the first set of data...or does it even have to be that way in order for it to be one daily set of data per row.

    Thanks for any help!




    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Sierra Mtns TS Data</title>
    <meta content="thumbnail view" name="description">
    <meta content="keene" name="author">
    </head>
    <body bgproperties="fixed" >
    <SCRIPT LANGUAGE="javascript">
    <!--
    document.write("<P ALIGN=right><l>" + Date()+"<\/l><\/P>")
    // -->
    </SCRIPT>

    <H1 ALIGN=Center>Sierra Thunderstorm Worksheet</H1>



    <form action="http://localhost/cgi-bin/SierraTS.cgi" method="POST">

    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tr>
    <align=center><B><font size="4">Today's <B>Local<B> Date (DDMMYY)</B>
    <td style="vertical-align: top; text-align: center;">
    <input type="text" name="DATE" size=6 maxlength=6>
    </td>
    </tr>
    </table>

    <H2 ALIGN=Center>Description of Day</H2>
    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>Did Thunderstorms Occur?</B>
    <td style="vertical-align: top; text-align: center;">
    <select name="TS">
    <option value="TS">Yes</option>
    <option value="SHRA">Only Showers</option>
    <option value="CU">Only Cumulus</option>
    <option value="NO CU">Clear Skies</option>
    </td>
    </tr>
    </table>


    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>Coverage</B>
    <td style="vertical-align: top; text-align: center;">
    <select name="CVG">
    <option value="ISOLD">Isolated</option>
    <option value="SCT">Scattered</option>
    <option value="WDSPR">Widespread</option>
    <option value="NOCOV">None</option>
    </td>
    </tr>
    </table>

    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>Reroutes</B>
    <td style="vertical-align: top; text-align: center;">
    <select name="RER">
    <option value="YesRer">Yes</option>
    <option value="NoRer">No</option>
    </td>
    </tr>
    </table>

    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>Trough Axis 35N and North</B>
    <td style="vertical-align: top; text-align: center;">
    <select name="TROF">
    <option value="140E">140W-135W</option>
    <option value="135E">135W-130W</option>
    <option value="130E">130W-125W</option>
    <option value="125E">125W-120W</option>
    <option value="120E">120W-115W</option>
    <option value="NoTrough">No Trough</option>
    </td>
    </tr>
    </table>
    <br>
    <br>
    <br>

    <H2 ALIGN=Center>Forecast Indices from 12Z NAM for 00Z</H2>
    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>LI</B>
    <td style="vertical-align: top; text-align: center;">
    <input type="text" name="FCLI" size=6 maxlength=6>
    </td>
    </tr>
    </table>
    <br>

    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>MUCAPE</B>
    <td style="vertical-align: top; text-align: center;">
    <input type="text" name="FCMUCAPE" size=6 maxlength=6>
    </td>
    </tr>
    </table>
    <br>


    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>Precipitable Water (In)</B>
    <td style="vertical-align: top; text-align: center;">
    <input type="text" name="FCPW" size=6 maxlength=6>
    </td>
    </tr>
    </table>
    <br>






    <H2 ALIGN=Center>Observed Indices from KREV 12Z</H2>


    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>LI</B>
    <td style="vertical-align: top; text-align: center;">
    <input type="text" name="12LI" size=6 maxlength=6>
    </td>
    </tr>
    </table>
    <br>


    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>MUCAPE</B>
    <td style="vertical-align: top; text-align: center;">
    <input type="text" name="12MUCAPE" size=6 maxlength=6>
    </td>
    </tr>
    </table>
    <br>

    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>Precipitable Water (In)</B>
    <td style="vertical-align: top; text-align: center;">
    <input type="text" name="12PW" size=6 maxlength=6>
    </td>
    </tr>
    </table>
    <br>

    <H2 ALIGN=Center>Observed Indices from KREV 00Z</H2>


    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>LI</B>
    <td style="vertical-align: top; text-align: center;">
    <input type="text" name="00LI" size=6 maxlength=6>
    </td>
    </tr>
    </table>
    <br>


    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>MUCAPE</B>
    <td style="vertical-align: top; text-align: center;">
    <input type="text" name="00MUCAPE" size=6 maxlength=6>
    </td>
    </tr>
    </table>
    <br>

    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>Precipitable Water (In)</B>
    <td style="vertical-align: top; text-align: center;">
    <input type="text" name="00PW" size=6 maxlength=6>
    </td>
    </tr>
    </table>
    <br>


    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tr>
    <B> <align=center>TVL-P68 Gradient at 21Z</B>
    <td style="vertical-align: top; text-align: center;">
    <input type = "text" name=GRAD size=4 maxlength=4>
    </td>
    </tr>
    </table>

    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tbody>
    <tr>
    <B><text-align:center>CCFP</B>
    <td style="vertical-align: top; text-align: center;">
    <select name="CCFP">
    <option value="YesCcfp">Yes</option>
    <option value="NoCcfp">No</option>
    </td>
    </tr>
    </table>


    <table width=400 align=center style="text-align: left;" target="_blank" border="1"
    cellpadding="2" cellspacing="2">
    <tr>
    <B> <align=center>Shift Notes</B>
    <td style="vertical-align: top; text-align: center;">
    <textarea name=NOTES rows=4 cols=40>
    </textarea>
    </td>
    </tr>
    </table>




    <input type="submit">
    <br>
    <br>
    <br>
    <input type="reset">
    </form>
    <br>

  • #4
    Regular Coder
    Join Date
    May 2007
    Posts
    162
    Thanks
    13
    Thanked 0 Times in 0 Posts
    One more thing...to clarify, each paramater I wrote as "objective" or "subjective" will be going into separate columns. So one row/day of data would be 17 columns long after both scripts have been run.
    Shad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •