Anyone use phpMyadmin?

Associate
Joined
11 Mar 2005
Posts
1,168
Afternoon all,

I've just ventured into the world of php and mysql. I have a database set up on my webhost - but am finding it difficult to import tables into the database...

Every time I try and import a csv/txt file, i get an sql error in the dialog box..

Is there an easy way to do this!?

Any help would be gratefully appreciated!

Thanks,
 
Yup - check they match up :)

Right! Well that worked - sort of! :)

I think because the csv file has been set up poorly, it doesnt like importing it!

I created a new csv file with the requisite number of fields and it imported the data fine...

hmm!

Will try again but if not, I'll be back for more assistance! Thanks beansprout :)
 
Code:
LOAD DATA INFILE 'filename.csv' INTO `table` FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n';
Just run that using the MySQL command line.
 
Last edited:
Right - thanks chaps... I figured out there was an extra "" that wasnt encapsulated so it only imported the first 30000 rows d'oh! All sorted now! :)

Last question - is there an easy way to code a front end?? Or am i using drop downs, etc and executing php scripts off them?

Right - all sorted. I've managed to connect to the database etc - but I cant seem to view my tables.. the code to access is below:

$dbuser="generalram2";
$dbpass="pass";
$dbname="name"; //the name of the database
$chandle = mysql_connect("XX.XXX.XXX.XXX", $dbuser, $dbpass)
or die("Connection Failure to Database");
echo "Connected to database server<br>";
mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found." . $dbuser);
echo "Database " . $database . " is selected";
mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found." . $dbuser);
mysql_close($chandle);


?>

How do I use php to view the table 'info' ?
 
Last edited:
Back
Top Bottom