Counting rows in two files and posting warnings on PHP webpg
Posted: Sun Aug 21, 2011 3:20 am
I receive two Excel files every week that I upload in my database.
File1: (110 columns, 1500 rows).
A B C D
st1 F 20 30
st2 M 21 31
st3 F 22 32
File 2: (115 columns, 1600 rows)
A E F B C D
st1 100 200 F 20 30
st2 101 201 M 21 31
st4 104 204 M 24 34
1) I am writing simple queries like counting rows in column B. Do I have to combine both tables to find the count? If so, how would I be able to to that?
sql1 = "SELECT File1.B FROM File, GROUP BY File1.B";
sql2 = "SELECT File2.B FROM File, GROUP BY File2.B";
2) How can I capture mySQL warnings and post on my PHP webpage?
My desired output is:
col B, count
F, 2
M, 2
File1: (110 columns, 1500 rows).
A B C D
st1 F 20 30
st2 M 21 31
st3 F 22 32
File 2: (115 columns, 1600 rows)
A E F B C D
st1 100 200 F 20 30
st2 101 201 M 21 31
st4 104 204 M 24 34
1) I am writing simple queries like counting rows in column B. Do I have to combine both tables to find the count? If so, how would I be able to to that?
sql1 = "SELECT File1.B FROM File, GROUP BY File1.B";
sql2 = "SELECT File2.B FROM File, GROUP BY File2.B";
2) How can I capture mySQL warnings and post on my PHP webpage?
My desired output is:
col B, count
F, 2
M, 2