I am a beginner

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Plasma
Forum Newbie
Posts: 5
Joined: Wed Dec 22, 2004 8:38 pm

I am a beginner

Post by Plasma »

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".
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

i suggest you use google and search for tutorials, or see if your local school is offering some suitable classes.

but if you are offering money, you should post this in the job hunt forum

i highly doubt someone will volunteer to be your dedicated teacher for free.
Plasma
Forum Newbie
Posts: 5
Joined: Wed Dec 22, 2004 8:38 pm

Post by Plasma »

My highschool sucks.
Plasma
Forum Newbie
Posts: 5
Joined: Wed Dec 22, 2004 8:38 pm

Post by Plasma »

I'd be lucky to find one computer class.
Plasma
Forum Newbie
Posts: 5
Joined: Wed Dec 22, 2004 8:38 pm

Post by Plasma »

Thanks for your help though.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

I will help you...

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();
?>
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
  $query_db = "select * from customers where domain_name='blah'";
  $execute_query = mysql_query($query_db,$connect);
?>
Post Reply