473,699 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cannot import excell table in mysql

232 New Member
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\tes t\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 2166
wizardry
201 New Member
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 New Member
@kkshansid
I think you missed, mysql_query() part, and BTW this (Parse error: syntax error, unexpected T_STRING in C:\wamp\www\tes t\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
2018
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 -c -u vidhya ifmonitor > $HOME/ifmonito.backup. this is ok , ifmonitor-backup has the table creation info as well as the table data .
15
4211
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 data. They are setup as follow, with a few more columns on the rights as stock prices, dividend and so on as: Date Code Country Adjust Reason Name Shares 25/02/2005 FR0000045072 FR CREDIT AGRICOLE
8
6550
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 macro. (I'll get to using VB later on). What I would like to do is import a single workbook w/three seperate worksheets into three seperate access tables AND truncate the time stamp that is used in the excell sheet via a macro.
7
4193
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 things this way because it made things easy. Well, I'm the person that has to put up with the long-term headache. Anywho, someone at work wants things sped up, so what I'm looking at doing is this for each client:
2
2039
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 mysql editor LOAD DATA LOCAL INFILE 'pet.txt' INTO TABLE pet; it has been exported but now the problem is insted giveing my id no as id_0033 it is giving Id_0033along with a box suffixed to the id and this is only to last coumn why is it showing so...
7
38114
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 import data directly to Ms Access but there is problem with my access for now so i have to think of other choises. i wanted to know whether it is easy to convert excel sheets to postgre that is can i import excel to postgreSQL. if yes how can i go...
2
1630
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) that are dates. When I have done my import the dates change to some number for some reason. 19/02/2007 changes into 39132. I've got an idea why it is done (dates are stored as long in access) but I got no idea how to get around this. This only happens...
2
1412
by: TMINGO | last post by:
Can you give me steps on how to import a table from excell to acess
3
2171
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 MS Excell / CSV files into MySQL? Your kind quick reply is highly appreciated.
0
8689
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8618
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9035
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8885
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6534
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.