473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

cannot import excell table in mysql

232 100+
cannot import table in mysql
1i saved my excell file in csv formate
2i made a data base in mysql
3i made a table with 5 fields
4i run this file


error
Parse error: syntax error, unexpected T_STRING in C:\wamp\www\test\hi.php on line 16
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. echo"hi";
  3.  $conn=mysql_connect("localhost","root","");
  4.              if(!($conn)) die("could not connect");
  5.  
  6.             $db=mysql_select_db("asdf");
  7.             if(!($db)) die("database not found");
  8. LOAD DATA INFILE 'D:\backup\institutes.csv' INTO TABLE 'inst'; 
  9. ?>
Jul 13 '09 #1
2 2145
wizardry
201 100+
here is a link for what your trying to acomplish
http://blog.tjitjing.com/index.php/2...in-5-easy.html
Jul 24 '09 #2
Canabeez
126 100+
@kkshansid
I think you missed, mysql_query() part, and BTW this (Parse error: syntax error, unexpected T_STRING in C:\wamp\www\test\hi.php on line 16) is PHP error, not mySQL. Your code should look like:

Expand|Select|Wrap|Line Numbers
  1.             $conn=mysql_connect("localhost","root","");
  2.             if(!($conn)) die("could not connect");
  3.  
  4.             $db=mysql_select_db("asdf");
  5.             if(!($db)) die("database not found");
  6.             mysql_query("LOAD DATA INFILE 'D:\backup\institutes.csv' INTO TABLE 'inst';", $conn); 
  7.  
Jul 24 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Vidhya CS | last post by:
Hi , I am trying to export a database from one machine ie linux, and import the same database to another machine ie ,solaris . I exported the database using the following command . mysqldump...
15
by: daniroy | last post by:
Hello everybody, your help will be very very welcome on a very classic question... I have some Excell Macro background, a little bit of VBA knowledge. I import daily from Internet series of...
8
by: Nick M | last post by:
Hello All, Excellent info here Thanks! I am very new to using access in general and I am on a learning curve. I'm trying to import an excel workbook (with worksheets) into an access db via a...
7
by: Randy | last post by:
Folks: We have a web-based app that's _really_ slowing down because multiple clients are writing their own private data into a single, central database. I guess the previous programmer did...
2
seshu
by: seshu | last post by:
hi every body This is seshu i have doubt in mysql i have some date in excell sheet to export that data i have copied all the data into a text file and the wrote this code in...
7
nehashri
by: nehashri | last post by:
hello i have my data stored in different Ms Excell sheets. now I am planning to make a database of the data i have. but i m confused whether to use Postgresql or mySQL for the same. i had plans to...
2
by: Twanne | last post by:
Hi, I've got these files in excell that need to be imported to access. Now I've got one file, and when I try to import it, it acts weird. There are two fields in the excell fiile (Start, Stop)...
2
by: TMINGO | last post by:
Can you give me steps on how to import a table from excell to acess
3
by: ahmurad | last post by:
Dear brothers, I have some importnat files in MS Excell / CSV format. I know php. I want to insert these files into MYSQL database to generate reports. What are the techniques to insert the ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.