![]() |
|
#11
|
||||
|
||||
Re: MySQL error when uploading CSV file1. The date needs to be entered as a string, so use single quotes around the value.
2. There are more variables in this script than necessary. 3. For splitting a string on a single character, explode() is faster than split(). PHP Code:
4. Omit the semicolon from the end of queries given to mysql_query(). Here is a simpler script: PHP Code:
Last edited by MisterChucker : 23-Apr-2009 at 12:52.
|
||||
|
#12
|
||||
|
||||
Re: MySQL error when uploading CSV fileOops, I noticed I have the date parts in the wrong order. The line should look like this:
PHP Code:
|
|
#13
|
|||
|
|||
Re: MySQL error when uploading CSV fileHi! Thanks for your reply.
I tried your little script but it didn't work [still got 0000-00-00] and then i tried your suggestions just in case but I still got 0000-00-00. Maybe it needs to be changed into a date format in PHP first? |
|
#14
|
||||
|
||||
Re: MySQL error when uploading CSV fileHere are some things that could cause the date to appear to be inserted as 0000-00-00, in descending order of probability.
1. Insert queries will not insert a record if another record has the same primary key. Make sure your query is not trying to insert a record that already exists. 2. Make sure the date in your query has single-quotes around it. 3. When you tried my script, did you add the appropriate mysql_connect() and mysql_select_db() statements? 4. When you tried my script, did you make the change to the date order that I posted? |
|
#15
|
|||
|
|||
Re: MySQL error when uploading CSV fileThanks! I accidentally put it in a different column. [I've updated the code since] Sorry for all of the trouble!
|
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 08:44 |
| After execution - Error cannot locate /Skin File? | WSCH | C++ Forum | 1 | 05-Mar-2005 21:03 |
| CD burner wont burn!! | robertli55 | Computer Hardware Forum | 1 | 18-Jun-2004 11:53 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 12:28 |
| CD Buring Failed | skanth2000 | Computer Hardware Forum | 1 | 15-Nov-2003 04:52 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The