Hello guys,
What I want to do is I want to read out a csv file and then but te conent ot the file in a msql datbase .
So far it works but the problem I haven that if I want to let te script to the typing for me so that I dont have to fill in the Values of the MySQL query myself It doesn't work
This is my code so far :
<?php
$dbhost = 'localhost';
$dbuser = 'y';
$dbpass = 'x';
$dbname = 'test';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die;
mysql_select_db($dbname);
$file = fopen("test.csv", "r") or exit("Unable to open file!");
//Output a line of the file until the end is reached
while(!feof($file))
{
echo fgets($file). "<br />";
}
fclose($file);
mysql_query("INSERT INTO test
(Naam,Geboortedatum, Leeftijd,woonplaats, Geslacht) VALUES('$file','$file', '$file','$file','$file' ) ")
or die(mysql_error());
if (!mysql_query($sql,$conn))
{
die('Error: ' . mysql_error());
echo "Gegevens toegevoegd";
}
mysql_close($conn)
?>
Output Buffering question
Hi all, I've been trying to wrap my head around output buffering. So far I've found tons of benifits but I'm wondering about the downside of output buffering. Problems it creates, whether or not it
Need PHP help... have all the elements... just need help putting them together :
Hey Guys, I was wondering if someone could help me. I am doing a website for a client which is about warranties and insurance. There is an enquiry form which the customer will fill in, and when they
Displaying an image using echo command
I had done a query on my database, one of the fields being an image reference to a directory where an image is stored. e.g "/images/picture.jpg"I want to display this image by using
PHP arrays into arrays need help
HelloI am trying to highlight the days on my calendar based on the dates that i have in my database. Currently I can only get it to display the last element in the database which leads me to believe
DirectoryIterator and Hacked Website
Hi Everyone.My problem:Some one has been sneaking in to my website hidden Iframes. I've changed passwords & reset permissions to read, but then the permissions get changed to include write and
set xml path in flash when xml created in memorystream and webrequest
i am creating an xml file using memory stream and i want to load this xml file into the flash on client scriptso the flash can load data from the streamed xml but i am unable to give path in xml guide
Parse Error Help
Hello, I got the parse error "Parse error: syntax error, unexpected ',' in register.php on line 21Heres the code:Code: <body
Saving PHP output as a file
I wondered if anyone knows how to save the rendered output of a PHP script as a file?I have a script that creates dynamic PDF documents, but want to save it as a file, rather than render it to the
Default TimeZone
The server I'm working with is hosted in America so all times inserted into the database are coming out 5 hours differen't to what I want them to. I attempted placing the following in my Header
session variables not working anymore
hello,i use sessions to handle authentication within my site. my host has been changing a lot of settings in the server recently for "security purposes". and the technicians are pretty much