|
-
Nov 27th, 2002, 09:50 PM
#1
Thread Starter
Addicted Member
Need MySQL Database
I'm messing with PHP and I need a MySQL database with 5 fields, id, real_name, username, password, and email. How do I go about making one?
Thanks,
- Allen
- Visual Basic 6.0
- Windows XP Home
-
Nov 27th, 2002, 09:56 PM
#2
Stuck in the 80s
You mean you need a table with that? Tables hold records. Databases hold tables.
The easiest way would be to download phpMyAdmin and use it to create your tables.
Otherwise you'd have to do something like this:
Code:
//the below was generated with phpMyAdmin:
$sql = 'CREATE TABLE `table1` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT,
`real_name` VARCHAR( 50 ) NOT NULL ,
`username` VARCHAR( 16 ) NOT NULL ,
`password` VARCHAR( 16 ) NOT NULL ,
`email` VARCHAR( 255 ) NOT NULL ,
INDEX ( `id` )
);'
$result = mysql_query($sql) or die(mysql_error());
if ($result) {
echo "Success!";
} else {
echo "Failure...";
}
-
Nov 28th, 2002, 01:10 AM
#3
Thread Starter
Addicted Member
hmmmm..... Perhaps I mean table... I know absolutely nothing.... I'm trying to follow the instructions on the site below:
http://www.evilwalrus.com/viewcode/24.php
Do I need a table or a DB or both ?
- Allen
- Visual Basic 6.0
- Windows XP Home
-
Nov 28th, 2002, 06:34 AM
#4
Fanatic Member
-
Nov 28th, 2002, 12:48 PM
#5
Thread Starter
Addicted Member
Manual ? There's a manual ?
- Visual Basic 6.0
- Windows XP Home
-
Nov 28th, 2002, 05:29 PM
#6
Stuck in the 80s
-
Nov 29th, 2002, 10:56 AM
#7
Member
If you're using windows, phpTraid won't be a bad idea, search for it on www.download.com
www.php.net -- A must.
-
Nov 29th, 2002, 06:16 PM
#8
Stuck in the 80s
Originally posted by SystemShock
If you're using windows, phpTraid won't be a bad idea, search for it on www.download.com
www.php.net -- A must.
php.net isn't going to do him a lick of good on how to create a database...
-
Nov 30th, 2002, 11:48 AM
#9
Thread Starter
Addicted Member
LOL.... when you guys get sorted out what I should do, let me know. 
Hobo, did you look at the site up there ^ to see what I'm trying to copy ?
- Allen
- Visual Basic 6.0
- Windows XP Home
-
Nov 30th, 2002, 07:25 PM
#10
Conquistador
You need a mysql server.
Then you need to create a database under the name of "secretDB"
You could change the name of the database to another, if you are assigned one by a free provider..
Basically, you need a mysql server on which you either have root access - to create databases, or where you have access to a current database.
Then you can connect using the standard php commands ->
mysql_connect etc
clearer now?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|