diode Posted November 26, 2006 Share Posted November 26, 2006 Hello,I am passing variables in the url such as: ?board=54Here is how I have my tables set up: I have a table called boards, with the following fields:boardno int NOT NULL, boardname varchar(30) NOT NULL, url varchar(30) NOT NULL, and the primary key is boardnoAnd the way I wanted to do it was to make an <html> table on the board index page listing all the different boards in the following format: It would show the title of the board as a link. The url of the link would be topiclist.php?board= and then the value of the boardno in its record in the sql table. I thought this would be an easy way to load the page that shows all the topics within that board, and the way I set out to do it was to select * from the table, whose name would actually be the value of the boardno. The only problem is that you can't create a table whose name is a number. So now I'm not sure exactly how I'm going to make it all smooth.If that was confusing, let me explain it this way, I wanted the board list page to load all the records from the boards table. Then, I was going to append the boardno at the end of the url for that board such as topiclist.php?board=43 or whatever. I then planned on topiclist.php selecting all the records from the table whose name would be equal to the boardno variable that was passed to it in the url. I thought this would be an easy way to load all the topics into the list, if only you could name tables with numbers.So how would a professional, experienced webmaster do this? What would be the most efficient way to have topiclist.php load all the records from the board whose id is equal to the variable passed to it in the url?I tried to explain this the best I could. My server is:Mac OS XApacheMySQLPHPMany thanks :D,diode Quote Link to comment https://forums.phpfreaks.com/topic/28492-msgboard-whats-the-best-way-to-name-the-tables-for-my-topics/ Share on other sites More sharing options...
diode Posted November 26, 2006 Author Share Posted November 26, 2006 Another advantage to the method I was trying to do would be that I could make each topic its own table, and then to keep the names different, I could just automaticaly increment the topic id. Again, if I am very wrong on this whole thing, please enlighten me on this. Thanks :D,diode Quote Link to comment https://forums.phpfreaks.com/topic/28492-msgboard-whats-the-best-way-to-name-the-tables-for-my-topics/#findComment-130405 Share on other sites More sharing options...
fenway Posted November 27, 2006 Share Posted November 27, 2006 Why don't you just have all of the topics for all of the boards in the same table? Why multiple tables? Quote Link to comment https://forums.phpfreaks.com/topic/28492-msgboard-whats-the-best-way-to-name-the-tables-for-my-topics/#findComment-130989 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.