Jump to content

jbalanski

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jbalanski's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi I was hoping to use wildcards in the statment for the CSV files.......reasoning is that there is about 200 + files coming in per day
  2. Hi could someone help with this? I need to import multiple CSV files into a mysql database then move the csv files to a log directory. I can import one csv with the following but how to I import multiple files ....each file only has one row of data. Also how would I move the csv file after import to another directory. Also if I put a record ID field in the table the import won't work any suggestions on that would be helpful. Thanks <?php $connection = mysql_connect("localhost", "user", "password") or die ("Unable to connect to server"); $db = mysql_select_db("DATABASE", $connection) or die ("Unable to select database"); $fcontents = file ('test.csv'); for($i=0; $i<sizeof($fcontents); $i++) { $line = trim($fcontents[$i], ',' ); echo "$line<BR>"; $arr = explode(",", $line); echo "$arr"; $sql = "insert into TABLE values ('". implode("','", $arr)."')"; mysql_query($sql); echo $sql ."<br>\n"; if(mysql_error()) { echo mysql_error() ."<br>\n"; } } ?>
  3. Could you explain further
  4. Maybe I am not making myself clear. (Maybe I am complicating it) I have a form with 16 date fields these are expiry dates for various certificates. We can do a query that will select the appropriate data ie any dates less than today and 90 days in the future. What ends up happening as you know is you get the user with 16 colums of dates with the one or two results from the query and the rest with dates that are over 90 days. I created a seperate table with userid expirydate and such but then adding via the form is difficult. Is there a way to highlight the query results in php so that if I get  the user and the 16 date colums is it possible to highlight those results ie be it bold or a different color so they are easily seen.
  5. I thought of doing seperate tables but I am just trying to do a report that selects all the users with the following expiry dates that are less then today or will expire within 90 days. If user one only has one expiry date he will show up if he has 2 expiry dates those dates and only those will show up if user 2 has 5 expiry dates I will see those and so on.
  6. Hi I have a table with 12 "expiry date: columns for different tickets. How can I do a query that would select all the expiry date columns that would include all dates less than today and also include 90 days in the future. I can't use multiple ANDS or OR's any suggestions? The following is my query as it goes through the query as I add and statements there is no data. The first statement after where brings back 50 rows if I add the second it then drops to 10 and so on.........hopefully this makes sense. SELECT users.lname, users.fname, users.positionappfor, users.hdsaliveexp, users.firstaidexp, users.fallproexp, users.whimisexo, users.regrescueexp, users.pitsexp, users.defdriveexp, users.otherexp, users.bopexp, users.boilerexp, users.confinedexp, users.loaderforkliftexp, users.jpickerboomerexp, users.boplineexp, users.tdgexp, users.detflameexp, users.driveexpire, users.driversabstract, users.drivedemerit FROM users WHERE (users.hdsaliveexp < date_sub(now(), interval -90 day)) AND (users.firstaidexp < date_sub(now(), interval -90 day)) AND (users.fallproexp < date_sub(now(), interval -90 day)) AND (users.whimisexo < date_sub(now(), interval -90 day)) AND (users.regrescueexp < date_sub(now(), interval -90 day)) AND (users.pitsexp < date_sub(now(), interval -90 day)) AND (users.defdriveexp < date_sub(now(), interval -90 day)) AND (users.otherexp < date_sub(now(), interval -90 day)) AND (users.bopexp < date_sub(now(), interval -90 day)) AND (users.boilerexp < date_sub(now(), interval -90 day)) AND (users.confinedexp < date_sub(now(), interval -90 day)) AND (users.loaderforkliftexp < date_sub(now(), interval -90 day)) AND (users.jpickerboomerexp < date_sub(now(), interval -90 day)) AND (users.boplineexp < date_sub(now(), interval -90 day)) AND (users.tdgexp < date_sub(now(), interval -90 day))
×
×
  • 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.