Okay I wrote this little script to upload a csv file that is located on my webhosts server to a mysql database. Something is wrong because I am getting the following error:
Warning: file(./html/beer/uploads/filename.csv) [function.file]: failed to open stream: No such file or directory in /home/content/d/l/a/dlanden/html/beer/uploads/upload_csv_mysql.php on line 12
insert into sunocoimport values ('')
Column count doesn't match value count at row 1
I did a syntax check and everything checked out. Here is the code:
$fcontents = file ('./html/beer/uploads/filename.csv');
# expects the csv file to be in the same dir as this script
for($i=0; $i<sizeof($fcontents); $i++) {
$line = trim($fcontents[$i]);
$arr = explode(",", $line);
#if your data is comma separated
# instead of tab separated,
# change the 't' above to ','
$sql = "insert into sunocoimport values ('".
implode("','", $arr) ."')";
mysql_query($sql);
echo $sql ."
n";
if(mysql_error()) {
echo mysql_error() ."
n";
}
}
?>
I am a newbie so any advice would be appreciated!
Including calander to page - will not show other months than current??
im trying to add an existaing calander onto a profile page by using Code: <?php include "diary/cal_show.php";?>which looks like this...But when i hit either arrows to move on
Count
Getting the same count everytimeCode: $visitquery = mysql_query("SELECT COUNT(*) FROM visitors WHERE ownerkey = '$uuid' & region = '$selected' AND `date` < DATE_ADD(CURDATE(),
Replacing a string on click of a button
Hi! Is there a way to replace a string on a click of a text link?This is what I've come up with. It doesn't work at all ^^;;Code: <head><?php $string = Red;function changeBlue()
first id from db not showing
I have a php script which displays the content of a mysql table as a html table with sorting, delete/update button, etc. the problem is I can't make it show the first value inserted in the db, it only
Blogging s/w
heya frndz!!! i want to start a blog.... m looking for a s/w like oscommerce which is thr for e-comm websites... so can u please suggest me some s/w through which i can set up the blog... thnx in
Ariba 9r - SAP MM Integration
Hi experts,
Need help with cin setw
I made a program here is my code:#include <iostream>#include <cstdlib>#include <iomanip>#include <ctime>using namespace std;int main(){ unsigned seed = 0; int randomNum; int
AUTONUMBER PROBLEM
Hello Everyone,
AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called through onClick="function ..." on the submit button. That all works perfectly, however the
Intrastat Report Config in ECC 6.0 - goods Movement in EU countries
Colleagues, need ur help to understand the changes require in ECC 6 standard Report configuration settings.