PDA

View Full Version : Creating new tables ...


29 Nov 2000, 00:03
Ok, I need to create a table (in the database) that uses two keys (userid and forumid) and one value stored (time). I know a little bit how to create a table, but I don't know everything about how the function used to do this works.

29 Nov 2000, 00:44
http://www.php.net/manual/ref.mysql.php

-jim

29 Nov 2000, 14:05
Yeah, that explains a bit about mysql functions ... but what I have to do uses "$DB_site->query("{query}")" instead of one of those mysql functions listed on there (although it may be the same as mysql_query()), what I have to do to create the table is use a function like this:

$DB_site->query("CREATE TABLE forumread (
timeread int(10) DEFAULT '0' NOT NULL,
forumid int(10) unsigned DEFAULT '0' NOT NULL,
userid int(10) unsigned DEFAULT '0' NOT NULL,
PRIMARY KEY (forumid),
UNIQUE userid (userid),
KEY userid_2 (userid))");

except that I want two fields and one row, not just one field like in the tables used for users, posts, threads, etc. and I'm not totally sure how to do this (which is why the code above may be wrong).

29 Nov 2000, 18:34
Install PHPMyAdmin on your server and use it to administer the database. You will find creating your tables a lot easier.

01 Dec 2000, 22:19
Yeah, I guess that would help ... I already know how to add/remove rows to a table, but not much about how to add/remove tables. Where can I get PHPMyAdmin, is it at the PHP home page?

01 Dec 2000, 22:27
Originally posted by Acmlm
Yeah, I guess that would help ... I already know how to add/remove rows to a table, but not much about how to add/remove tables. Where can I get PHPMyAdmin, is it at the PHP home page? http://www.phpwizard.net :)

01 Dec 2000, 22:41
Thanks :D

I'll look at that ...