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)
?>
help, header() is not working!
Hello, I have this code:<?php/** * @author samoi * @copyright 2009 */error_reporting(E_ALL & E_NOTICE);include ('func.php'); // this has the session_start() func!if
Database 'Validation'
Hi everyone,I'm trying to validate the password entered by the user with the password in the database. I've worked out that it checks the username fine (if the username doesn't exist it displays an
Custom CMS
This is a big custom CMS script I'd like to develop and would like some help atleast figuring out where the best place to start would be.Website PagesBackstage 2 provides website pages for the
my code does not work.
I have a code problem.Quote"<a href=index.php?gogo=ureticidetay&'?l={$letter}'>{$ letter}</a>" this is not working. but need link like this
filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I have a method, that is supposed to open a file and write to the file, but I am having issues. Each
mails going in spam??
The mails I sent to folks in my database using mail(function) are going in spam??Any idea how I rectify this issue?
WM transfer order: confirm different batch than proposed by system
Hi folks,
ldap connection
We are using ldap to get user information from the domain controller. It was working before. Recently I found the application is hanging at ldap_connect. It doesn't return any message. i am not sure
Program with calculate Meteorologic measurements
Hello I'm a beginner and I want to make a program with calculate Meteorologic measurements:
Getting number of affected rows in SQLPLUS..
Hi everyone,