webdogjcn Posted May 27, 2006 Share Posted May 27, 2006 I have no clue how I want to do this, but I am putting up some tutorials on my website and I want users to be able to write their own reviews of them. However, I am limited to one db for my whole site which means user accounts, articles, everything. Anyways I do not want to use a table for every article. I was even hoping I could have the users fill out a form and create a text file from the information and then just include it in my page. How would I do this. I am not sure where to start so if you could be as specific as possible. Quote Link to comment https://forums.phpfreaks.com/topic/10547-user-reviews/ Share on other sites More sharing options...
AndyB Posted May 27, 2006 Share Posted May 27, 2006 I can't think of any sensible reason to have a separate database table for each article. As well, the number of tables you can have in one database is huge (far in excess of the number of articles you'll ever write).Despite both those, the best method is to have one table for all the articles and have an autoincremented ID for the rows and then have a second table for all the reviews - just put the articleID as one of the fields in the reviews table. Then you'll be able to pull all of the reviews for a specific article any time you want. Quote Link to comment https://forums.phpfreaks.com/topic/10547-user-reviews/#findComment-39350 Share on other sites More sharing options...
webdogjcn Posted May 27, 2006 Author Share Posted May 27, 2006 okay thak you so much. I got it working. One Last Question:I want users to be able to post articles/tutorials on my site, but I dont want them to have to enter in stuff like "<p class=scripting></p>" to get their stuff to look right. So, I was wondering how I can process the form they send in and replace all things like [SCRIPT] with "<p class=scripting>" or [FONTCOL=blue] with "<font color='blue'>" etc. Anyways so the user would fill out a form like this:[code]<form action=articlepost.php method=post><input type=text name="artname"><textarea name="article"></textarea>[/code]And take whatever is in "article" and replace all occurances of BB style coding with the actual html before inserting it into the db Quote Link to comment https://forums.phpfreaks.com/topic/10547-user-reviews/#findComment-39359 Share on other sites More sharing options...
AndyB Posted May 27, 2006 Share Posted May 27, 2006 Instead of making it difficult for people to format articles the way they want, it might be better to use a 'smart textarea' that looks/works like a word-processor. Two excellent free such textarea editors are [a href=\"http://tinymce.moxiecode.com/\" target=\"_blank\"]TinyMCE[/a] and [a href=\"http://www.fckeditor.net/\" target=\"_blank\"]FCKEditor[/a]. Those could save you a lot of trouble. Quote Link to comment https://forums.phpfreaks.com/topic/10547-user-reviews/#findComment-39361 Share on other sites More sharing options...
webdogjcn Posted May 27, 2006 Author Share Posted May 27, 2006 alright I'll take a look at them, thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/10547-user-reviews/#findComment-39366 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.