[SC.LUG] MySQL frustration - the saga continues

Simeon Farrington simeonfarrington at totalise.co.uk
Sat Aug 14 01:00:41 BST 2004


OK, I've had another think and found some of what I was looking for (ie 
how to output). What I seem to be getting is a table with the correct 
number of records, but containing only null values:

mysql> SELECT * from towers
     -> ;
+---------+----------+--------+-------+-------+------+----------+----------+
| towerID | practice | branch | tower | bells | note | sundayam | evensong |
+---------+----------+--------+-------+-------+------+----------+----------+
|       1 | NULL     | NULL   | NULL  |  NULL | NULL | NULL     | NULL     |
|       2 | NULL     | NULL   | NULL  |  NULL | NULL | NULL     | NULL     |
|       3 | NULL     | NULL   | NULL  |  NULL | NULL | NULL     | NULL     |
|       4 | NULL     | NULL   | NULL  |  NULL | NULL | NULL     | NULL     |
|       5 | NULL     | NULL   | NULL  |  NULL | NULL | NULL     | NULL     |
|       6 | NULL     | NULL   | NULL  |  NULL | NULL | NULL     | NULL     |
|       7 | NULL     | NULL   | NULL  |  NULL | NULL | NULL     | NULL     |

So at least now I know that my data itself has gone astray! I just don't 
know why. Is there a good (or best) way of formatting incoming 
datafiles? Any clues as to why it isn't working based on the information 
below (and above)?

What is really annoying is that I know the answer must be very easy, but 
currently I don't know what is going on!

Thanks

Simeon


Simeon Farrington wrote:
> Hi all
> 
> I've been having a very entertaining week (ok, the brakes went on my car 
> whilst driving down a hill while going on holiday and hence I'm now 
> stranded!) learning php-MySQL within websites. I happily worked through 
> my dreamweaver book which set up the database for the purposes needed 
> and websites duly worked. I will point out at this stage that as I'm 
> playing with dreamweaver, I've got everything set up on a windows box. 
> However, as we're talking about mysql syntax here, I don't think this 
> will matter in this instance. Ultimately the plan is to move the 
> databases to the ISPs server and run things from there while I sort out 
> local servers etc.
> 
> Now I have a problem. I'm trying to create my own database and populate 
> it with data. This is surely a doddle to do, but at the moment I think 
> my chances of obtaining a cure for cancer or developing a working 
> procedure for time-travel are greater than getting this to work!
> 
> The set up is this. I have a table of data (called towers.csv) in text 
> (comma delimited) format which I wish to load into my table.
> 
> The table appears to be set up as expected (in that each of the column 
> names can be located by dreamweaver), but I cannot fathom how to get my 
> data (in bulk) to be appended to this table. On the one occasion it 
> looked like it might of worked, I wrote a test page of php-mysql 
> requests to access the data, but all I had returned was blanks! I don't 
> know what went wrong.
> 
> I have tried doing
> 
> mysql> LOAD DATA LOCAL INFILE 'E:\\towers.csv' INTO TABLE `towers` ;
> Query OK, 100 rows affected (0.01 sec)
> Records: 101  Deleted: 0  Skipped: 1  Warnings: 808
> 
> No information about the warnings, but clearly they are an issue given 
> my data isn't picked up when requested. The format of the data in the 
> input file was (first row column titles, second row is the first record 
> of the table):
> 
> ID,Day,Branch,Tower,Bells,Note,Sundayam,Evensong
> 1,Monday,Chester,Chester Cathederal,12,0,0,0
> 
> So the questions are (so far):
> 
> 1) How does one simply get bulk data into MySQL - I don't really want to 
> append each row line by line using mysql, although the time spent on 
> this exercise to now probably would have covered most of such a 
> laborious task.
> 2) Having (supposedly) got the data in, is there any simple way of 
> viewing the data? Previously at work I've used M$ Access where you can 
> at least view tables of data so you can see whether the dataitems have 
> gone to the right places etc. If I could do this then at least I'd know 
> where the data had gone!!!!!
> 
> WHat is really getting to me at the moment is that the documentation 
> merrily hurtles off into the stratosphere, yet a simple section on the 
> basics isn't forthcoming :(
> 
> So if anyone can help, PLEEEEEASE!!! If you need more information, let 
> me know
> 
> Thanks
> 
> Simeon
> 



More information about the SC mailing list