php and mySQL
| From: | Sam | Date: | Mon, 30 Oct 2000 14:55:58 +0000 |
| Subject: | php and mySQL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-22684@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to update a mySQL database, with the following mixture of PHP and
SQL.
Unfortunately it does not work. Could anyone please point me in the correct
direction.
function update_all_trips( $db, $userfile, $userfile_name, $userfile_size,
$userfile_type )
{
mysql_query("Delete from all_trips");
$sql_upload_all_trips ="LOAD DATA INFILE '$userfile' INTO TABLE all_trips
FIELDS TERMINATED BY ',' ENCLOSED BY \"'\"";
$res_upload_all_trips = mysql_query($sql_upload_all_trips)
or die("Cant insert Sam");
$successful = mysql_affected_rows($db);
print "<br>Hi sam, you have uploaded <b>$successful</b> records";
}//end function update_all_trips
function called by...
update_all_trips( $db, $userfile, $userfile_name, $userfile_size,
$userfile_type );
Thanks in advance
Sam Rose