This is some sample code to get you going. To pull stuff out of the database you connect to the server/database. Query the database. Display the results.
PHP Code:
<?php
$dbservertype
=
'mysql'
;
$servername
=
'mysql.x.com'
;
$dbusername
=
'user'
;
$dbpassword
=
'password'
;
$dbname
=
'database_name'
;
$Conn
=
mysql_connect
(
$servername
,
$dbusername
,
$dbpassword
,
true
);
mysql_select_db
(
$dbname
,
$Conn
);
$SQL
=
"SELECT supplierno FROM tbl_users WHERE username = '$user'"
;
$result
=
mysql_query
(
$SQL
,
$Conn
) or die(
mysql_error
());
while(
$row
=
mysql_fetch_array
(
$result
)) {
echo
$row
[
'supplierno'
];
}
?>
These are the key functons used:
mysql_connect()
mysql_select_db()
mysql_query()
mysql_fetch_array()
...make sure you read up on them in the php documentaion (php dot net).
How would I get this page(s) to display this data. How would I get the html/php etc code for the page to request the data from the database and display it how I want it to be displayed. I'm at a complete loss. I have a fair knowledge of html and little knowledge of php, the latter of which I believe is what I need?
Any help would be greatly appreciated.
Many Thanks! http://bbs.prog365.com/images/sites/smile.gif |