connection of PHP & MySQL

Status
Not open for further replies.
OP
T

Trinity

Journeyman
urgent

this query is damn urgent it wud be kind of u to find an answer to this & post a reply immediately to it.[/b]
 

cheetah

In the zone
OK....if u are gonna install something like PHPBB, Wordpress, PHP-Nuke and want to give the MYSQL DB information...then go as follows....

1. Create a new Database using PhpMyAdmin
2. Note the name of the Database, Your_Database_Username, Your_Databse_Password

3. Open the install.php file, in Database Name fill your databse name, in the username and password fields fill ur username and password and click install....the php will automatically connect to the mysql server's default port.....and will install the application....

U can make new databses, assign usernames and passwords through your servers MySql database manager....Generally if u have Cpanel installed...U can acces it through.....*www.your_site_name.com:2082/frontend/x/sql/index.html
 
OP
T

Trinity

Journeyman
lol....not soooo fast, but they r inter-linked & an essential ensemble for a good application. U know that!

We'll just to give u a bkgrd of wat i m upto - i m makin an application usin MySQL, PHP & Apache.

I m done with the installation of all the 3 but m facing difficulty in connecting MYSQL with php....where wud i get a ready-made , easy to use code from for this connection?

My Db is ready & so r the php forms

Have an answer?
 

tuxfan

Technomancer
YOu have already got an answer on what is PHPMyAdmin at some other thread.

As for CPanel, you can think of it as a front end to control various features and facilities of your hosting account. You need to have a domain name and a paid hosting account to use it. For more information and demo, you can go to *www.cpanel.net
 

alib_i

Cyborg Agent
typical code for connecting mysql looks like this ::
Code:
mysql_connect('localhost','<username>','<passw>');
@mysql_select_db('<databasename>') or die( "Unable to select database");
$result=mysql_query("select <column> from <table>");
$row=mysql_fetch_array($result);
$contents=$row['<column>'];
this will select the first row of your selected column in the table. if you want to select the next row, then call mysql_fetch_array again. typical usage is like this:
Code:
while ($row = mysql_fetch_array($result)) {
   $contents=$row['<column>'];
   echo $contents;
}

you asked for connection of php and mysql, so i gave you corresponding code. for making a database or table, you better learn how to use phpmysql or MySQL-Front


-----
alibi
 

kalpik

In Pursuit of "Happyness"
Yes alib_i has given u the code for making a connection to a MySQL database via PHP. I was just too lazy to type it! Actually its a copy paste code so i dont remember it anyway! :p

Anyway, u seem to be confused about this whole MySQL thing. MySQL is a database server. U can connect to it through diff methods. Basically all applications connect to the MySQL server through a TCP port (3360 or 3366 or something like this, told u im lazy!). The applications send requests to the MySQL server through this port. Anyway, this should give u a basic idea.
 
Status
Not open for further replies.
Top Bottom