bs0d |
Subject: "re: Create
members table
in databa..."
Posted: @ 8:17 pm on Oct 15 2005
|
|
|
 Member #: 1 Rank: Admin. - (1,505) Since: 02/06/05 Posts: 600 From: USA
|
bring up
phpMyAdmin
from the top of
the menu to the
left, click
"SQL&quo
t;. This will
open a window.
You'll see a
box that has
something
like:
"SELECT *
FROM WHERE
1" -->
Delete that
text where the
box is now
blank.
paste in this
code:
Code:
CREATE TABLE
`members` (
`user_id`
mediumint(8)
NOT NULL
auto_increment,
`username`
varchar(25) NOT
NULL default
'',
`user_password`
varchar(32) NOT
NULL default
'',
`user_email`
varchar(255)
NOT NULL
default
'',
PRIMARY KEY
(`user_id`)
) TYPE=MyISAM
AUTO_INCREMENT=
60 ;
this is the SQL
(structured
query language)
that will
create the
members table.
After you
paste, hit the
"GO"
; button to the
bottom right of
the box.
this should
create your
table.
|
Viewed: 19,050 Times | |  |
snatchsquad |
Subject: "re: Create
members table
in databa..."
Posted: @ 11:11 am on Oct 25 2005
|
|
|
Member #: 95 Rank: User - (6) Since: 10/25/05 Posts: 6
|
Ok. Once the
code is entered
and I created
the database.
How do I set it
up so my web
page will
access with
usernames and
passwords... I
remember seeing
a code for
this, but might
have
disappeared
when the site
went off line
for a couple
days.
free 10
minutes
midnighttreats.
com use
passcode:
treatme |
Viewed: 19,026 Times | |  |
bs0d |
Subject: "re: Create
members table
in databa..."
Posted: @ 1:14 pm on Oct 25 2005
|
|
|
 Member #: 1 Rank: Admin. - (1,505) Since: 02/06/05 Posts: 600 From: USA
|
|
Viewed: 19,018 Times | |  |
snatchsquad |
Subject: "re: Create
members table
in databa..."
Posted: @ 2:01 am on Oct 26 2005
|
|
|
Member #: 95 Rank: User - (6) Since: 10/25/05 Posts: 6
|
I guess my real
problem is how
to make the
database
connection. I
know that you
have to use a
source code,
but I am not
sure how I do
this or where I
put it. I went
to the database
connection
page, but it is
pretty brief
and over my
head. Thanks
for helping me
by the way!!
free 10
minutes
midnighttreats.
com use
passcode:
treatme |
Viewed: 19,008 Times | |  |
bs0d |
Subject: "re: Create
members table
in databa..."
Posted: @ 2:39 pm on Oct 26 2005
|
|
|
 Member #: 1 Rank: Admin. - (1,505) Since: 02/06/05 Posts: 600 From: USA
|
this is how you
can connect to
the database.
The inital
connection is
made with the
mysql_connect()
; function,
then selected
by the
mysql_select_db
(); function.
To make it
simpler (in
this code
sample),
variables are
set for each
parameter
(database host,
database
username and
pass, ect).
each time you
wish to
interact with
the database,
this code must
be executed
(makes the
connection).
You cannot
query any data
unless you are
connected, so -
thats why some
just put this
code in a file,
and call upon
it when they
need to
connect.
When you're
connected, you
can query the
database for
whatever you
need, or
execute
functions to
insert or
delete data.
Remember the
"Introduction
to
SQL
"
tutorial, read
up on that.
anything else,
just ask.
Code:
<?php
$database[dbser
ver]="db_
host.com"
;
$database[dbuse
r]="db_us
er";
$database[dbnam
e]="datab
ase_name"
;
$database[dbpas
s]="db_us
er_pass";
$table
="table1
";
$connect =
mysql_connect($
database['dbse
rver'],
$database['dbu
ser'],
$database['dbp
ass']);
$select=
mysql_select_db
($database['db
name']);
?>
Edited at 02:40:53 pm on 10/26/05
|
Viewed: 18,991 Times | |  |
snatchsquad |
Subject: "re: Create
members table
in databa..."
Posted: @ 1:46 am on Oct 29 2005
|
|
|
Member #: 95 Rank: User - (6) Since: 10/25/05 Posts: 6
|
But where do I
put that
code... In my
html?
Somewhere in my
webshell?
free 10
minutes
midnighttreats.
com use
passcode:
treatme |
Viewed: 18,967 Times | |  |
bs0d |
Subject: "re: Create
members table
in databa..."
Posted: @ 3:20 am on Oct 29 2005
|
|
|
 Member #: 1 Rank: Admin. - (1,505) Since: 02/06/05 Posts: 600 From: USA
|
Ok, whatever
file you have,
name it with a
.php extension.
If your file is
index.html,
rename it to
index.php so
the server side
code is
executed.
if it is a php
file, html code
will be
executed as
regularly, but
when the
browser comes
across the php
code, it is
executed by the
server and
output to the
browser as
html.
|
Viewed: 18,964 Times | |  |
snatchsquad |
Subject: "re: Create
members table
in databa..."
Posted: @ 7:26 pm on Oct 29 2005
|
|
|
Member #: 95 Rank: User - (6) Since: 10/25/05 Posts: 6
|
Hi, I think I
am close to
understanding
this...
my page is
http://snatchsq
uad.com/officer
sclub.htm
I need to
change it to a
.php, which I
understand.
When I put the
code you gave
me in the html
on frontpage,
it just shows
up on the page
as text. What
am I doing
wrong.
free 10
minutes
midnighttreats.
com use
passcode:
treatme |
Viewed: 18,956 Times | |  |
bs0d |
Subject: "re: Create
members table
in databa..."
Posted: @ 7:49 pm on Oct 29 2005
|
|
|
 Member #: 1 Rank: Admin. - (1,505) Since: 02/06/05 Posts: 600 From: USA
|
yes, make your
file name
"officers
club.php"
and when you
want php code
to be executed,
start off with
<? //php
code in here,
and end with
?> just like
that. Also,
make sure your
host supports
PHP. If your
host does not
support PHP on
their servers,
it would likely
just show up as
text.
|
Viewed: 18,953 Times | |  |
snatchsquad |
Subject: "re: Create
members table
in databa..."
Posted: @ 12:22 pm on Nov 02 2005
|
|
|
Member #: 95 Rank: User - (6) Since: 10/25/05 Posts: 6
|
So what are my
options if my
host doesn't
support PHP?
Do you know of
code for html
that will
perform the
same task?
free 10
minutes
midnighttreats.
com use
passcode:
treatme |
Viewed: 18,929 Times | |  |
bs0d |
Subject: "re: Create
members table
in databa..."
Posted: @ 1:12 pm on Nov 02 2005
|
|
|
 Member #: 1 Rank: Admin. - (1,505) Since: 02/06/05 Posts: 600 From: USA
|
no, thats the
thing about
php. Its a
server side
language that
allows you to
create dynamic
webpages. With
HTML, you can
only create
static
webpages.
Search google,
I think Lycos
offers free PHP
web hosting.
|
Viewed: 18,923 Times | |  |
Viewing Page: 1 of 1 |