0

Hi, I'm new member I saw this site and it is really interesting , I have new project I worked on it with html and php it is a web site for songs I built the whole site and now start programming the database for singers and songs what I need to ask about is how to start work on data base and connect it with my SQL can you help me? thanksalot

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by FlashCreations
0

go to www.php.net for all the little bits of information.
In short you have a host/database/username/password.
you user mysql_connect(host, database, username, password)
then start using mysql_query and mysql_fetch_array for retrieving info

0

w3schools is a great resource for learning the basics to mySQL databasing with PHP. Here is a link to their tutorials on mySQL in PHP:

http://www.w3schools.com/PHP/php_mysql_intro.asp

Best of luck

Hi, I'm new member I saw this site and it is really interesting , I have new project I worked on it with html and php it is a web site for songs I built the whole site and now start programming the database for singers and songs what I need to ask about is how to start work on data base and connect it with my SQL can you help me? thanksalot

0

In PHP it's fairly simple to connect to your MySQL database:

//Start by connecting to the database or die showing MySQL Error
 mysql_connect("localhost", "USERNAME", "PASSWORD") or die(mysql_error());

//Next select the database or die again showing the MySQL error
 mysql_select_db("DATABASE NAME") or die(mysql_error());

$result = mysql_query("SELECT * FROM query");  //Perform a query

//Cycle through rows with mysql_fetch_array, passing the query result
 while($row = mysql_fetch_array($result))
 {
    echo "Row: " . $row['column_name'];  //Echo a column from the row
 }

These are the basics to MySQL in PHP. For a more detailed tutorial on MySQL, I would suggest W3Schools MySQL Tutorial. After that, explore the PHP MySQL Tutorial on W3schools for more detailed information. Good Luck...and be sure to post any MySQL or PHP related question to the forums!

Edited by FlashCreations: n/a

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.