Hi,
I have been learning PHP/MySQL and JavaScript from Robin Nixon's book on the subject. I studied the code from the last chapter to create a rudimentary social network. I have worked through all of the code, and I find it very easy to understand. However, just out of curiosity, I went to the MySQL command line to have a look at the tables I created. I was only expecting the four tables created with the "rnsetup.php" document, but I found that there are a whole list of tables that have been created, and I'm not sure where they are coming from (e.g. sessions, short_cut_set, node, node_access, field_config, etc. there are probably about 50 tables).
I'm familiar (intermediate level) with database design, but I was not expecting these tables to be created, and I'm not sure how it happened. I didn't download any SQL scripts to create the schema, so as far as I know, I should only have the four tables I created in the setup.php script.
Does anyone know where these other tables are coming from? I have a feeling they were somehow created by PHP session functions or something like that in the process of using running, but I am just not sure. It is also possible that they were created by NetBeans (The IDE I'm using).
Can anyone explain why these tables showed up, and why I need them? Is there a resource out there that describes their presence?
Thanks
Tom
Robin Nixon's "Robin's Nest" unexpected tables created
Moderator: General Moderators
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Robin Nixon's "Robin's Nest" unexpected tables created
I don't believe PHP creates any MySQL tables, and none of those are the tables that MySQL uses itself. We'd need to see rnsetup.php.
Re: Robin Nixon's "Robin's Nest" unexpected tables created
Now I think I downloaded Drupal and accidentally associated it with this database. I must have forgotten about it. I've been learning over a period of time, and I don't recall what happened when I downloaded Drupal (I think I thought I would just have a look at it, but decided it was best to go with a standard PHP/MySQL tutorial. The rnsetup.php file looks like this (I renamed it to jbsetup.php):
jbfunctions.php obviously contains the function that creates the tables.
Code: Select all
<?php
include_once 'jbfunctions.php';
echo '<h3>Setting Up</h3>';
createTable('jbmembers','user VARCHAR(16), pass VARCHAR(26), INDEX(user(6))');
createTable('jbmessages',
'id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
auth VARCHAR(16), recip VARCHAR(16), pm CHAR(1),
time INT UNSIGNED, message VARCHAR(4096),
INDEX(auth(6)), INDEX(recip(6))');
createTable('jbfriends','user VARCHAR(16), friend VARCHAR(16),
INDEX(user(6)), INDEX(friend(6))');
createTable('jbprofiles','user VARCHAR(16), text VARCHAR(4096),
INDEX(user(6))');
?>
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Robin Nixon's "Robin's Nest" unexpected tables created
Right, those sound like Drual tables indeed.