I am a beginner
Moderator: General Moderators
I am a beginner
I am barely began PHP and I got interested in MySQL, I may need help on it. If you are patient enough to teach me step by step, email me at s0ev@yahoo.com , or instant messege me on my AIM screen name "nickx".
I will help you...
Now all you need to do is fill in the user name, password, and database name, the database link is contained in the $connect variable.
To connect to the database or run queries, here is some sample code...
Code: Select all
<?php
define ("sql_user", "username_here");
define ("sql_pass", "password_here");
define ("db_name", "database_name_here");
function database_connect()
{
$link_id = mysql_connect('localhost', sql_user , sql_pass);
mysql_select_db(db_name, $link_id);
return $link_id;
}
$connect = database_connect();
?>To connect to the database or run queries, here is some sample code...
Code: Select all
<?php
$query_db = "select * from customers where domain_name='blah'";
$execute_query = mysql_query($query_db,$connect);
?>