note 106778 deleted from function.fgetcsv by thiago

From: Date: Tue, 06 Dec 2011 12:59:51 +0000
Subject: note 106778 deleted from function.fgetcsv by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-184929@lists.php.net to get a copy of this message
Note Submitter: supaman at firedub dot com ---- This is my source code. Write by http://www.firedub.com/ header( "content-type: text/html; charset=UTF-8" ); //set language to utf-8 $FILE = fopen( "record.csv", "r"); //open file and read $data = fgetcsv( $FILE , 1024 ); $i=1; do { if ($i == 1){ //unread first row $data = fgetcsv( $FILE , 1024 ); $i++; } else{ include "connect.php"; //file connect DB. $sql="INSERT INTO employee(record_id,employee_id,employee_name) VALUES ('$data[0]', '$data[1]', '$data[2]');"; $dbquery=mysql_db_query($dbname,$sql); mysql_close(); $data = fgetcsv( $FILE , 1024 ); $i++; } }while ( !feof( $FILE ) ); Thank you. I am a php programmer beginner.

« previous php.notes (#184929) next »