I'm trying to use phpmyAdmin to import a file. I keep getting a "invalid field cont in csv file" error. At present I am trying to test the process. The error is on this line.
Field 1:
Air Products' Internet Strategy
Field 2:
Air Products and Chemicals Inc., a leading chemicals and gases company, employed 15,000 people worldwide. In fiscal year 1995 Air Products' sales were up 11% to $3.9 billion; net income was $368 million; and cash flow reached $797 million-all records. The capital-intensive company was rapidly expanding internationally, and it was up to the Management Information Systems (MIS) Vice President, Peter Mather, to design the technological infrastructure that would continue to enable the expansion. Mather's core MIS group developed the infrastructure and cross information technology services supporting the business areas of Air Products worldwide. After 29 years with the company, Mather carried a blueprint in his mind of criss-crossing and overlapping telecommunications networks, wide area networks, local area networks; and layers of enterprise-wide services including electronic mail, video conferencing and the electronic desktop. However promising the commercial Internet appeared, Mather believed that it would provide little value to the company unless it fit appropriately into Air Products' larger technological infrastructure. What would the costs and revenue stream look like in the "electronic frontier?"
I suspect it is because of some of the punctuation in the fields but they cannot be changed. Can anyone suggest a way around this. My table name is called Application. The fields are called Title and Description. Thanks
Having trouble uploading .csv file into mySQL
Moderator: General Moderators
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
OK I can try that. Also, having still earning, some of my code is showing up on my web page. I was hoping someone could point out my error.
Code: Select all
<?php
// Search Code
// Standard Connection Data.
$db_host = "localhost";
//$db_user = "myusername";
//$db_pass = "password";
//mysql_connect("localhost");
//mysql_select_db("test" user="root" password=" ");
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
die('Not connected : ' . mysql_error());
}
// make cpdata the current db
$db_selected = mysql_select_db('test', $link);
if (!$db_selected) {
die ('Can\'t use test : ' . mysql_error());
}
//$db_name = "test";
//$dbac = mysql_connect($db_host);
//mysql_select_db ($db_name) or die ("Cannot connect to database");
if (!$_POST['search']){
// Breaking out of php to display the form.
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "****://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta ****-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Courseware Search Form</title>
<body>
<center><img src="login_shield.gif" alt=""></center><br>
<center><table width="500"><tr><td><p><font size="3" color="#993333"><center>Courseware Database Search<center></b></p><br><br><p></p>
<p>This search will result in the data you searched for to be displayed in a list.</p>
<p>From the list, click the title of the course you are interested in viewing.</P>
<p>The detail of this course will be displayed.</p>
In the search box below tell us what your looking for. <br>
If you only know part of the name or word you want to search for thats alright,<br>
well find it for you!!
</td></tr></font></table><br>
<center><form name="Search" size="20" method="post" action="" size="48">
<font color="#993333">Enter Your Search Criteria Here:<br>
<label>
<input name="swords" type="text" size="30" maxlength="30">
</label>
<br>
<label>
<input name="search" type="submit" id="search" value="Search">
</label>
</form></center>
<?php
}else{
// Adding slashes and changing tags so that people trying to take advantage of the system can't
$searchwords = addslashes(htmlspecialchars($_POST['swords']));
// Checking the length of string to make sure its more than 1 characters long
if (strlen($searchwords) < 1){
echo "The selection you have entered is too short, please enter another one.";
}else{
$words = explode(' ',$searchwords);
$totalwords = count($words);
$i = 0;
$searchstring = "";
// Looping to get the search string.
while ($i != $totalwords){
if ($i != 0 and $i != $wordcount){
$searchstring .= " and ";
}
$searchstring .= "description LIKE '%$words[$i]%' or defaultcpt LIKE '%$words[$i]%' ";
// Incrementing the value
$i = $i + 1;
}
// Execute the query with the search string just created.
$query = mysql_query("SELECT * FROM application where $searchstring");
// Check for results
echo mysql_error();
if (mysql_num_rows($query) == 0){
echo mysql_error();
echo "No results where found sorry ";
}else{
while ($fet = mysql_fetch_array($query)){
echo "<p>title: {$fet['title']}<br />
Description: {$fet['description']}<br />
</p>";
}// End While
}// End Else
}// End Else
}// End Else
?>