View Full Version : Creating new tables ...
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.
<a href="http://www.php.net/manual/ref.mysql.php" target="_blank">http://www.php.net/manual/ref.mysql.php</a>
-jim
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).
Install PHPMyAdmin on your server and use it to administer the database. You will find creating your tables a lot easier.
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?
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 :)
Thanks :D
I'll look at that ...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.