ello all,
i have an excel .csv file that i am using navicat to convert to mysql. the format i recieve the csv file in looks like this:
Code:
fname lname vend op date
bob smith vend1 op1 2007-31-01
0 0 0 op2 0000-00-00
it looks the same after converting to sql. (sorry, can't make the columns line up on here for some reason)
the null row with the exception of the "op field" is what is messing me up.
bob had 2 things done under his name but when i search for bob smith and echo the "op" i only get the first op. if i search for "op2" and echo the results i get nothing.
is there any way anyone can think of to make this work? the way the report is run is fixed and i am stuck trying to make this output work if possible.
i took a closer look at the file last night, it's like this:
Code:
bob smith vend1 op1 2007-31-01
op2
after the navicat conversion it fills the blank fields with 0's like this:
Code:
bob smith vend1 op1 2007-31-01
0 0 0 op2 0000-00-00
if there is just a single row, everything works perfect. it is just when there are multiple "ops" under a single name that i can't pull the data properly.
exactly. the ops that go under the name are related to the name above. that is where the issue is. it has no way to relate the name to the empty rows below it.
i'll see what i can tweak in navicat and see how it goes...
well, had to go to a dbase file instead. i guess the report generator was having issues creating a csv. still have the same null problem...
spoke with navicat, nothing the program can do. like you said it is just doing what it can with the data provided.
is there a way to get the null rows to be related somehow? i was thinking there had to be a way to get the query to read the rows as one till it hits a row that is !== to "". does that make any sense? possible? am i screwed? lol
Your brother already owes us more beer than you can guzzle...
It would be possible to alter a (MySQL) table on the fly though I see that as a highly questionable practice.
The cleanest solution would be to have one table with fields:
"pk_id","fname","lname","vend"
and then another one with fields:
"fk_id", "op"
This way, you wouldn't care how many "op1" and "op2" showed up in the excel/.csv sheet.
Of couse, if "op"-types are limited to 3, then use 3 fields. But if the list/length is variable, the above option is your lifeline, I think.
how would i split the info between the tables? send it all to one table then use php to fill the other tables? i can't split the data in navicat during conversion. only way would be after it is in sql and on the server.
the number of ops is not a constant, most i've seen on the reports is 12 to a specific person and that is pretty rare.
heh, i thought we had this thing beat till we started throwing live data at it.
Bookmarks