Jump to content

Search the Community

Showing results for tags 'cvs'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. this is the scrip i currently have but i get "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range,groups,b_m,product_code,desc_1,desc_2,qty,nett_price,goods_value) VALUES (' at line 1" <?php if (isset($_POST['submit'])) { if(is_uploaded_file($_FILES['filename']['tmp_name'])){ $handle = fopen($_FILES['filename']['tmp_name'], "r"); while(($data = fgetcsv($handle,1000,",")) !==false) { $ST=$data[0]; $date=$data[1]; $actual_date=$data[2]; $account=$data[3]; $branch=$data[4]; $customer_name=$data[5]; $i_c=$data[6]; $invoice_num=$data[7]; $category=$data[8]; $order_no=$data[9]; $order_item=$data[10]; $range=$data[11]; $groups=$data[12]; $b_m=$data[13]; $product_code=$data[14]; $desc_1=$data[15]; $desc_2=$data[16]; $qty=$data[17]; $nett_price=$data[18]; $goods_value=$data[19]; $query = "INSERT INTO sales_orders (ST,date,actual_date,account,branch,customer_name,i_c,invoice_num,category,order_no,order_item,range,groups,b_m,product_code,desc_1,desc_2,qty,nett_price,goods_value) VALUES ('$data[0]','$data[1]','$data[2]','$data[3]','$data[4]','$data[5]','$data[6]','$data[7]','$data[8]','$data[9]','$data[10]','$data[11]','$data[12]','$data[13]','$data[14]','$data[15]','$data[16]','$data[17]','$data[18]','$data[19]')"; mysql_query($query) or die(mysql_error()); } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo COMPANY_NAME; ?> | Sales Figures Upload Screen</title> <link href="<?php echo ROOT; ?>css/login.css" type="text/css" rel="stylesheet" /> <link type="text/css" href="<?php echo ROOT; ?>css/start/jquery-ui-1.8.7.custom.css" rel="stylesheet" /> <script type="text/javascript" src="<?php echo ROOT; ?>js/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="<?php echo ROOT; ?>js/jquery-ui-1.8.7.custom.min.js"></script> </head> <body> <div id="box"> <div id="content"> <h1>Sales CSV Update</h1> <p>Please use a valid CSV file extracted from Exant Exporter.</p> <form method="post" action="uploadsale.php" enctype="multipart/form-data"> <p> <input type="file" name="filename"/> </p> <input name="submit" type="hidden"/> <button tabindex="4" type="submit">Upload Data</button> </form> </div> </div> </body> </html> <?php mysql_close($connection); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.