Reply
Store articles in database
Old 05-31-2006, 03:50 PM Store articles in database
Skilled Talker

Posts: 87
Hi, how do I store articles in a database?
__________________
Visit AnmarTech and the AnmarTech Forums. You won't regret it. Link exchanges are welcome with sites with appropriate content.
agent14 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-31-2006, 03:57 PM Re: Store articles in database
chrishirst's Avatar
Super Moderator

Latest Blog Post:
Am I impressed or what?
Posts: 14,831
Location: Blackpool. UK
A very broad question, and the broad answer is;

as text.

would you like to be a little more specific so we can be of more help
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-31-2006, 09:13 PM Re: Store articles in database
Skilled Talker

Posts: 87
I mean store text articles.
__________________
Visit AnmarTech and the AnmarTech Forums. You won't regret it. Link exchanges are welcome with sites with appropriate content.
agent14 is offline
Reply With Quote
View Public Profile
 
Old 05-31-2006, 09:33 PM Re: Store articles in database
chrishirst's Avatar
Super Moderator

Latest Blog Post:
Am I impressed or what?
Posts: 14,831
Location: Blackpool. UK
errm Yes, Guessed that much. Simply asking
Quote:
Hi, how do I store articles in a database?
means the answer is
You have some code and put them there.

only you have the questions that we may or may not be able to answer.

So we'll start a question and answer session.

Do you have any code?
Do you want some code?
Do you have a database?
Can you run server side code?
If so what?

have you bought/found/downloaded or otherwise aquired a script from somewhere?
do you want to buy a script?
do you want a script writing?

are these your own articles or are you just jumping on the latest overblown idea of having yet another articles database among the many hundreds that are around already?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-31-2006, 09:44 PM Re: Store articles in database
Skilled Talker

Posts: 87
I have a server, yes I have code, yes I have a database, yes I can run server side code. There are my own articles.
__________________
Visit AnmarTech and the AnmarTech Forums. You won't regret it. Link exchanges are welcome with sites with appropriate content.
agent14 is offline
Reply With Quote
View Public Profile
 
Old 06-01-2006, 05:28 AM Re: Store articles in database
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
I do it like thus:

tables

articles(id,type,title, summary, published, expires, active, keywords) id primary key
page(pid, aid, content) aid foreign key links to id from articles

select * from articles a left join pages p on a.id=p.aid where p.pid in (1,2,3,4,5); grabs the article and its pages.

As everytrhing is an article (including competitions if you run them) you can use the published and expirey fields (which are dates) so you can turn on or off articles based on dates without having to do anything.

Use the type to differntiate between different article types. I.E. News=>100, Features=>200 etc etc

Ibbo
__________________
www.nationalclubgolfer.com www.sportspub.co.uk www.bespokecc.co.uk www.centralmarquees.co.uk
Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf

Last edited by ibbo : 06-01-2006 at 05:29 AM.
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Old 06-01-2006, 10:28 PM Re: Store articles in database
Skilled Talker

Posts: 87
Thanks Ibbo, I was fiddling around after I posted yesterday with my phpMyAdmin database and when I was trying to upload an article the following error came up -
SQL query:
& lt ; ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" & gt;

& lt ; ? php require( "/home/arf4tvfggds/public_html/forums/SSI.php"
)

Then further on...
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or' at line 1

Any advise? Or a tutorial?
__________________
Visit AnmarTech and the AnmarTech Forums. You won't regret it. Link exchanges are welcome with sites with appropriate content.

Last edited by agent14 : 06-03-2006 at 05:01 PM.
agent14 is offline
Reply With Quote
View Public Profile
 
Old 06-02-2006, 03:26 AM Re: Store articles in database
chrishirst's Avatar
Super Moderator

Latest Blog Post:
Am I impressed or what?
Posts: 14,831
Location: Blackpool. UK
Ok We have established that you have PHP and MySQL

The simplest way then is to download a PHP CMS script, lots of them at http://www.hotscripts.com/PHP/Script...nt_Management/

and install that on your site.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-02-2006, 09:15 AM Re: Store articles in database
Skilled Talker

Posts: 87
Okay thanks I'll try it out.
__________________
Visit AnmarTech and the AnmarTech Forums. You won't regret it. Link exchanges are welcome with sites with appropriate content.
agent14 is offline
Reply With Quote
View Public Profile
 
Old 06-02-2006, 10:02 AM Re: Store articles in database
Skilled Talker

Posts: 87
Could you check out http://anmartech.com I'm trying to use the database so that the articles can be read(the site isn't complete yet as you can see). I also want users to be able to search for articles, using the title, content and date. And I also want to be able to show the top most read articles, for example 5. My web hosts has content management systems which I opted not to use, Drupal, Geeklog, Joomla, Mambo Open Source, PHP-Nuke, phpWCMS, phpWebSite, Post-Nuke, TYPO3 and XOOPS.
__________________
Visit AnmarTech and the AnmarTech Forums. You won't regret it. Link exchanges are welcome with sites with appropriate content.

Last edited by agent14 : 06-02-2006 at 10:10 AM.
agent14 is offline
Reply With Quote
View Public Profile
 
Old 06-02-2006, 08:51 PM Re: Store articles in database
Skilled Talker

Posts: 87
No help...
__________________
Visit AnmarTech and the AnmarTech Forums. You won't regret it. Link exchanges are welcome with sites with appropriate content.
agent14 is offline
Reply With Quote
View Public Profile
 
Old 06-02-2006, 11:56 PM Re: Store articles in database
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
Converting Video For YouTube
Posts: 2,337
Name: Keith Marshall
Location: West Hartford, CT
Everytime I view this thread, I'm always greeted with a Login diolog box.

cPanel for ip 70.98.54.10
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 06-03-2006, 01:01 AM Re: Store articles in database
vangogh's Avatar
Post Impressionist

Posts: 8,923
Name: Steven Bradley
Location: Boulder, Colorado
I think I fixed the cPanel thing. I'm not seeing it anymore now. If anyone still is please let me know. Thanks.
__________________
l Search Engine Friendly Web Design | Van SEO Design
l Tips On Marketing, SEO, Design, and Development | TheVanBlog
l Custom WordPress Themes
| Small Business Forum
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 06-03-2006, 09:29 AM Re: Store articles in database
Skilled Talker

Posts: 87
That is my site's i.p.How'd the cPanel login get there? Elaborate please
__________________
Visit AnmarTech and the AnmarTech Forums. You won't regret it. Link exchanges are welcome with sites with appropriate content.
agent14 is offline
Reply With Quote
View Public Profile
 
Old 06-03-2006, 12:13 PM Re: Store articles in database
chrishirst's Avatar
Super Moderator

Latest Blog Post:
Am I impressed or what?
Posts: 14,831
Location: Blackpool. UK
when you posted the error message, you also posted a button image which the forum tried to show.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-03-2006, 03:39 PM Re: Store articles in database
vangogh's Avatar
Post Impressionist

Posts: 8,923
Name: Steven Bradley
Location: Boulder, Colorado
Just a little extra stuff there with the copy and paste. I edited your post and removed the extras that were causing the problem.
__________________
l Search Engine Friendly Web Design | Van SEO Design
l Tips On Marketing, SEO, Design, and Development | TheVanBlog
l Custom WordPress Themes
| Small Business Forum
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 06-03-2006, 05:01 PM Re: Store articles in database
Skilled Talker

Posts: 87
Ok thanks.
__________________
Visit AnmarTech and the AnmarTech Forums. You won't regret it. Link exchanges are welcome with sites with appropriate content.
agent14 is offline
Reply With Quote
View Public Profile
 
Old 06-09-2006, 11:11 AM Re: Store articles in database
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Quote:
Originally Posted by chrishirst
when you posted the error message, you also posted a button image which the forum tried to show.
Did no one exploit it?

Bit slow there guys, well caught mods.
__________________
www.nationalclubgolfer.com www.sportspub.co.uk www.bespokecc.co.uk www.centralmarquees.co.uk
Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Old 06-09-2006, 10:50 PM Re: Store articles in database
Skilled Talker