Thread: Question
View Single Post
Old 02-05-2005, 07:19 PM   #1 (permalink)
Magma
 
Junior Techie

Join Date: Apr 2003

Posts: 53

Magma

Send a message via AIM to Magma Send a message via Yahoo to Magma
Default Question

Im wondering how I can do this, I want to make a page which will call the DB and connect to it load the data.

for example


Page would show

User: SQL User
Active: SQL Yes/No
Email: SQL Email
UserID: SQL UserID

How would I go about making it so the SQL User etc. shows the value which is in the table?

This is what I learned so far..

so example would be

Include.php
Code:
<?
$username="Example";
$password="PasswordTest";
$database="new_db";
$table="tablename";
?>
then the code to call

page.php
Code:
<?
include("include.php");

mysql_connect(localhost,$username,$password);

@mysql_select_db($database) or die( "Unable to select database");

$query="SELECT * FROM users";
$result=mysql_query($query);
$num=mysql_numrows($result); 
mysql_close();
?>
if the Table USERS had

User: SQL User
Active: SQL Yes/No
Email: SQL Email
UserID: SQL UserID

It should show up as

User: Test
Active: Yes
Email: Something@something.com
UserID: 1

Correct?
__________________
http://img165.imageshack.us/img165/8...r562600sj9.gif
CPU:AMD 3000+
RAM:1gb PC 3200
GFX:Nvidia FX5200 128mb
HDD:120gb 7200rpm, 200gb 7200rpm
OS:Windows XP Home SP1+2

Half-Life 2 Completed in Under 11 Hours
Magma is offline