| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi all, I'm currently creating a php application where the user can actually insert data from the csv file into the database table. The truncating function works, however, I found out that the insertion of the data has a little bug. For example, i have 5 rows of data in the csv file, but when it is inserted into the database, it only inserts one row out of the five rows of data. Can anybody help? Thanks! Below is a code snippet that i used to truncate and insert data in the table in my database. $query = "INSERT INTO timetable values('$linemysql')"; mysql_select_db($database, $test); mysql_query("TRUNCATE TABLE timetable") or die("MySQL Error: " . mysql_error()); //Delete the existing rows mysql_query($query, $test) or die('SQL ERROR:'.mysql_error()); // INsert in the new values into the database |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.