4
Contributors
7
Replies
19
Views
4 Years
Discussion Span
Last Post by cmps
0

which language is best to study in this trend... php and mysql..

Edited by Pravinraj

0

You need to choose the tools for the job. If you're using PHP and MySQL, you should look into either the MySQLi or PDO extensions for PHP. These will let PHP connect to your MySQL database.

0

can you explain how to connect website with datbase using PHP.......

0

Very easy,here's a detailed connection PHP & MySQL:

//$variables to use in the connection
$host = 'localhost'; //Most of the time it''s 'localhost' but may be different
$user = 'root'; //username
$pass = ''; //password
$db = 'daniweb';

//first you have to make the connection, if not made => mysql_error()
$connection = mysql_pconnect($host,$user,$password);

//select the datbase you want to use, if not found => mysql_error()
mysql_select_db($db,$connection) or die(mysql_error());

//now the sql part
$query = mysql_query("SELECT * FROM table");

//fetch results
$row = mysql_fetch_assoc($query);

//Count results (optional)
$row_num = mysql_num_rows($query);

That's it !!

Edited by cmps

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.