okay, i did this ...
++++++++++++++++++++++++++
<?php
/* Connecting, selecting database */
$link = mysql_connect("localhost",
or die("Could not connect : " . mysql_error());
print "Connected successfully";
mysql_select_db("newdb") or die("Could not select database");
/* Performing SQL query */
$query = "LOAD DATA LOCAL INFILE '/var/www/html/PHPs/010403
$result = mysql_query($query) or die("Query failed : " . mysql_error());
/* Printing results in HTML */
print "<table>\n";
while ($line = mysql_fetch_array($result,
print "\t<tr>\n";
foreach ($line as $col_value) {
print "\t\t<td>$col_value</td>\n
}
print "\t</tr>\n";
}
print "</table>\n";
/* Free resultset */
mysql_free_result($result)
/* Closing connection */
mysql_close($link);
?>
++++++++++++++++++++++++++
then i get this error ..
Connected successfullyQuery failed : 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 ''' at line 2
what's the problem?
Main Topics
Browse All Topics





by: DoppyNLPosted on 2003-10-26 at 23:04:11ID: 9625248
Take a look at the manual pages on php.net, it will explain all you need to know.
http://www.php.net/mysql
Most helpfull will probably be the example on that page, since that gives you an example on how to do it.
Allthough it's not really neccesary to release results and close the database connection in your script (php does that automaticly at the end of the script).