Hello All,

I am geting a error with this peice of code:

<?php

//Set variables for Connecting to the database
$conn = mysqli_connect( "localhost", "UN", "PW", "DBN" )
or die( mysql_error() );

//Set variable to creat table if not existing
$sql = "CREATE TABLE IF NOT EXISTS nfnpdb-t
        (
        EIN  int(11)
        PNO  varchar(70)
        )";

$file = "uploads/eo_ma.lst"

if( mysql_query( $conn, $sql )) {

// BRING FILE INTO ARRAY
$rows = file( '$file' );
foreach( $rows as $i => $row ) {

// PARSE EACH LINE
$data = array();
        $data[0] = substr( $row, 1,9);
        $data[1] = substr( $row, 10,79);

// INSERT ARRAY INTO DATABASE NOW
$sql = "INSERT INTO nfnpdb-t VALUES
        (
        $data[0],
        '$data[1]',
        )";

mysqli_query( $conn, $sql );
}
}

mysqli_close( $conn );
?>

the error is:
Parse error: parse error in
/home/httpd/vhosts/seas-network.org/httpdocs/convert-upload-data.php
on line 16  <--- Note that with all ofter fields it would be line 46.

Thank you for any and all help with this.

By the way if the is a better way to write this please show me :-)







Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to