Take the 2-minute tour ×

I've made a database using phpMyAdmin , now I want to make a register form for my site where peaple can register .I know how to work with input tags in HTML and I know how to insert data into a database but my problem is that I don't know how I can connect to the database that is already made in phpMyAdmin.

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

The database is a MySQL database, not a phpMyAdmin database. phpMyAdmin is only PHP code that connects to the DB.

mysql_connect('localhost', 'username', 'password') or die (mysql_error());
mysql_select_database('db_name') or die (mysql_error());

// now you are connected
share|improve this answer
add comment

Set up a user, a host the user is allowed to talk to MySQL by using (e.g. localhost), grant that user adequate permissions to do what they need with the database .. and presto.

The user will need basic CRUD privileges to start, that's sufficient to store data received from a form. The rest of the permissions are self explanatory, i.e. permission to alter tables, etc. Give the user no more, no less power than it needs to do its work.

share|improve this answer
z.about.com/d/musiced/1/0/-/8/viola.jpg What permissions does one need to do what they need to with the viola? –  Lotus Notes Mar 29 '10 at 5:49
@byronh: The viola is used to keep sleepy stack overflow users from making typographical errors :) –  Tim Post Mar 29 '10 at 5:52
add comment

Your Answer


