View Full Version : hi
almodcom
11-27-2007, 06:22 AM
hi , i'm new in programing , i need help from some one who know how to make Database connection with the php websites. i have a school site and i need to make a database and on the web to allow the access for the students to see there marks and print it, if some one can give me on line classes in how to do it and i will pay him please. thank you
What kind of database are you connecting to?
I have used PHP & MySQL database before and I used this website:
http://www.php-mysql-tutorial.com/connect-to-mysql-using-php.php
Which has plenty of useful tutorials, I'm no expert at PHP but if you give it a shot and post your results we will try help you out. :)
almodcom
11-27-2007, 05:56 PM
thank you for your reply and thanking your kind
i'm using the myphpadmin that provided by the cpanle as i have RC-1 plan and . i have seen how to make a database , but i want to learn where should i place the codes for the php connection so the user will enter his username and password to retrave data from the database.
i do not know php.
thank you again
nvillescas
11-27-2007, 06:52 PM
This is going to be very complicated for someone who doesn't know php. Creating a connection to the database is fairly simple, but creating a login system that allows certain users to only see certain items in the database can get very complicated.
In order to create a connection to your database via php, you need to know four things:
Location of the database ('localhost' is common for most servers)
User/Login name for the database
Password for the database
The database name
Once you know those pieces of information you can write some simple php code like this:
<?php
$db = mysql_connect('database location','user/login name','password') or die('Unable to connect');
mysql_select_db('database name',$db) or die('Unable to select database');
?>
Or just check out the link that Josh listed.
ParodyUK
11-28-2007, 04:44 AM
and to make it easier,
Put that code into a file called, config.php
and then use this code to make it appear on all pages,<?php include ("config.php") ?>
presentationmal
02-08-2008, 04:01 PM
hi , i'm new in programing , i need help from some one who know how to make Database connection with the php websites. i have a school site and i need to make a database and on the web to allow the access for the students to see there marks and print it, if some one can give me on line classes in how to do it and i will pay him please. thank you
Even i have the same doubt can any one suggest me.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.