Saturday, June 16, 2007

PHP Database_mysql episode I

Hi again, sorry for the delay for blogging code especially in this very lovely language. PHP..

So every beginner in php want to know how he can connect to a mysql server and retrieve data from the database and present it in his webpage.

In this lesson I will present the first portion of this ..

HOW to connect to the database.

Before you copy the code.. you have to know that the code below needs to have some changes before that can work correctly..

So you have to change the values of the variables (connection parameters: servername, databasename, user, password)..

After running the script you will goit a message saying that the connection has been attempted..

If you got anything else, then you have an error somewhere. If you need my help, comment out here. And I will help soon..

<?php

//this code is presented by Developpers Blog.. Http://developpers.blogspot.com

//it's this very simple way to connect to a database

//all what you need is to change the variables values with correct values.


 

//list of variables, you may need to change the values between quotations

$host = "localhost";

$database = "mydatabase";

$user = "user";

$pass = "password";


 

//try to keep this lines without changes, only if you know what you are doing.

//you can change the text between quotation if you want


 

$conn = mysql_connect($host,$user,$pass) or
die(mysql_error());

if ($conn){


 

    $selectdb = mysql_select_db($databse);

    if($selectdb){

        echo
"Connection attempted";

    }

    else{

        echo
"Can't connect to the databse. please contact the system administrator.";

    }

}

else{

    echo
"Can't connect to the server..please contact the system administrator.";

}

?>

Thursday, March 22, 2007

John Perkins, Part 1 at the VFP National Convention

John Perkins, Part 1



Whatch video here

The first of a three part speech given to the Veterans For Peace National Convention, Seattle, WA in August 2006. Author of Confessions of an Economic Hit Man, in this part John discusses, from a hit mans perspective, the reasons and background to why we are at war in the Middle East.

Wednesday, February 14, 2007

welcome to my blog

hi

this is Raghed Edris Blog i will post my knowledge in all fields.
cu later