Jump to content

curtm

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

curtm's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a table with names and ssn's. I am importing data into this table using php. Sometimes part of the data is not correct, but I need to import the other info anyway. For example, instead of using a real ssn, they may have put something like "Not Online". The table I am importing into requires a proper ssn. What I want to accomplish is after I verify the FORMAT of the ssn, and find it to be invalid, I want to set the ssn to "000000000" and then check if that ssn EXISTS in the table already (some of the data is duplicate), and if that ssn exists, add one (000000001) and repeat the checking of its existence. Basically I want to find the next lowest ssn available that doesn't already exist in my table. I can already check to see if a ssn exists and add one if it does, but I am lost when it comes to getting the script to loop after that until the ssn does not exist. Any help would be appreciated!
  2. curtm

    thanks

    thanks guys that worked!
  3. I tired that and it doesn't work. Notice: Undefined variable: day in C:\Inetpub\wwwroot\arforecastermohs.php on line 265
  4. I have 60 days of deposits. I want to show a list of what each days deposit, plus the previous day, plus the next day equals. I could write like this... $day1 = $day0 + $day1 + $day2; echo "1 - "; echo $day1; echo "<br>"; for each day, but I'm lazy and time is short. How do I do this... $x=2; $times = 59; while ($x < $times) { $prev = $x-1; $next = $x+1; $deposit = $day$x + $prev + $next; echo $x; echo " - "; echo $deposit; echo "<br>"; ++$x; } The $day$x is where I'm having problems. thanks
  5. I'm using the EXPLODE function now, but that doesn't help me get the names in the right fields. If one guy puts fname lname and the next guy puts fname m lname, the explode would have to have conditions for the names to go in the right field.
  6. I have some emails that I'm parsing into a database. In those emails, there are names. the names have no controls on the way they are typed in, so I have data like so... fname m lname fname m. lname fname m lname suffix fname mname lname fname lname fname lname suffix How can I parse this so I get the right data in the right field? I have fname m lname for my database fields. thanks!
  7. Correct. 8 consecutive days totalling more than 70 hours = violation
  8. And now for the twist.... The number values are hours and minutes, so 11 hours and 15 minutes on day 4 shows like this... $day04 = 11.15 How can I make the computer think that .60 = 1 for adding purposes?
  9. What if I want to add every 8 days instead of 7 like my original post? (sorry, the user that wants this told me wrong)
  10. Here is the code, and it works now! <?php //connect to database $connectionstring = odbc_connect("as400", "user", "password"); //SQL quyery $Query = "select DLDY01,DLDY02,DLDY03,DLDY04,DLDY05,DLDY06,DLDY07,DLDY08,DLDY09,DLDY10,DLDY11,DLDY12,DLDY13,DLDY14,DLDY15,DLDY16,DLDY17,DLDY18,DLDY19,DLDY20,DLDY21,DLDY22,DLDY23,DLDY24,DLDY25,DLDY26,DLDY27,DLDY28,DLDY29,DLDY30,DLDY31, DRCODE from IESFILE.DRVRHOUR, IESFILE.DRIVERS where DLDRVR = DRCODE and DRTDAT = 0 and MONTH(CURRENT_DATE)=DLMNTH and DLYEAR = YEAR(CURRENT_DATE) order by DRCODE"; //execute query $queryexe = odbc_do($connectionstring, $Query); //query database while(odbc_fetch_row($queryexe)) { //collect results $drcode = odbc_result($queryexe, 32); $day01 = odbc_result($queryexe, 1); $day02 = odbc_result($queryexe, 2); $day03 = odbc_result($queryexe, 3); $day04 = odbc_result($queryexe, 4); $day05 = odbc_result($queryexe, 5); $day06 = odbc_result($queryexe, 6); $day07 = odbc_result($queryexe, 7); $day08 = odbc_result($queryexe, ; $day09 = odbc_result($queryexe, 9); $day10 = odbc_result($queryexe, 10); $day11 = odbc_result($queryexe, 11); $day12 = odbc_result($queryexe, 12); $day13 = odbc_result($queryexe, 13); $day14 = odbc_result($queryexe, 14); $day15 = odbc_result($queryexe, 15); $day16 = odbc_result($queryexe, 16); $day17 = odbc_result($queryexe, 17); $day18 = odbc_result($queryexe, 18); $day19 = odbc_result($queryexe, 19); $day20 = odbc_result($queryexe, 20); $day21 = odbc_result($queryexe, 21); $day22 = odbc_result($queryexe, 22); $day23 = odbc_result($queryexe, 23); $day24 = odbc_result($queryexe, 24); $day25 = odbc_result($queryexe, 25); $day26 = odbc_result($queryexe, 26); $day27 = odbc_result($queryexe, 27); $day28 = odbc_result($queryexe, 28); $day29 = odbc_result($queryexe, 29); $day30 = odbc_result($queryexe, 30); $day31 = odbc_result($queryexe, 31); for($i = 1; $i <= 25; $i++){ $total = 0; for($j = 0; $j < 7; $j ++){ $n = sprintf("%02d", $i + $j); $total += ${'day' . $n}; if($total > 70){ break; } } if($total > 70){ // VIOLATION echo $drcode; echo "Violation!!!!"; echo "<br>"; } } } //disconnect from database odbc_close($connectionstring); ?>
  11. I have a PHP script that returns some number values as variables like so... $day01 = 5 $day02 = 8 ... $day31 = 6 I want to find out a way to easily see if any 7 in a row of the day variables totals to more than 70. So if $day01 + $day02 + ... + day07 = 69, do nothing, but if $day05 + day06 + ... + $day11 = 71, echo "Over 70 violation!". Is there a way to do this easily or am I going to have to make a WHOLE BUNCH of If statements? thanks!
  12. How would I accomplish the following... In a string containing either action="target.php" or action=target.php how would I strip out everything except target.php ? I am going to be using this on multiple forms, and i have no idea whether the forms will have the quotes or not. thanks!
  13. Here is what I have working so far... $sFile = file_get_contents("http://www.domain.com", False); preg_match_all("/(\<[ \\n\\r\\t]{0,}tr[^>]*\>|\<[^>]*[\\n\\r\\t]{1,}tr[^>]*\>){1} ([^<]*<([^(\/>)]*(\/[^(t>)]){0,1}(\/t[^(r>)]){0,1})*>)* (\<[ \\n\\r\\t]{0,}\/tr[^>]*\>|\<[^>]*[\\n\\r\\t]{1,}\/tr[^>]*\>){1}/i", $sFile, $matches); foreach ($matches as $val) { echo "matched: " . $val[0] . "\n"; echo "part 1: " . $val[1] . "\n"; echo "part 2: " . $val[3] . "\n"; echo "part 3: " . $val[4] . "\n\n"; } The script above prints "matched:" and "part1" .... for every <tr> on domain.com, So I am getting closer, but I don't get the code after preg_match_all - all the <'s and >'s and \'s - how does that stuff work? I think if I can get it to pull out everything between <form and </form> I can get the rest to work. Thanks!
  14. I need help creating a script please. I need a script where I could enter in a url, click submit, and have the script go to that url, look for "<form" and then pull out the method="xxxx" and the action="xxxxxxxxxxxxxxxxx" and all of the input name="xxxxx" and options and selects. Basically, I want an easy way to find out where a form is being submitted to, and all the form valune names. Can anyone help with this? Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.