Be a Supporter!

Php: Rss Feed Creaton

  • 1,163 Views
  • 9 Replies
New Topic Respond to this Topic
elbekko
elbekko
  • Member since: Jul. 23, 2004
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Php: Rss Feed Creaton 2005-12-18 10:30:39 Reply

PHP: Main

Since I couldn't post it in here, I made the tutorial on a web page:
PHP: RSS Feed tutorial

Have fun with it!


"My software never has bugs. It just develops random features. " - Unknown

[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]

BBS Signature
Taylor
Taylor
  • Member since: Aug. 19, 2003
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Php: Rss Feed Creaton 2005-12-18 16:25:44 Reply

I r teh winnar!

mysql_query("CREATE TABLE 'rss' ('id' INT( 11 ) NOT NULL ,'title' VARCHAR( 255 ) NOT NULL ,'link' VARCHAR( 255 ) NOT NULL ,'description' LONGTEXT NOT NULL ,'pubDate' VARCHAR( 255) NOT NULL) TYPE = MYISAM ;") or die(mysql_error());

Taylor
Taylor
  • Member since: Aug. 19, 2003
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Php: Rss Feed Creaton 2005-12-18 16:27:22 Reply

And I'm a fucking retard:

$query = "CREATE TABLE `rss` (
`id` INT( 11 ) NOT NULL ,
`title` VARCHAR( 255 ) NOT NULL ,
`link` VARCHAR( 255 ) NOT NULL ,
`description` LONGTEXT NOT NULL ,
`pubDate` VARCHAR( 255 ) NOT NULL
) TYPE = MYISAM";
if(!$query) {
die(mysql_error());
}else{
echo 'Talbes created successfully!';
}

Newgrounds should employ code tags.

Craige
Craige
  • Member since: Jul. 17, 2004
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Php: Rss Feed Creaton 2005-12-18 16:35:24 Reply

At 12/18/05 04:27 PM, PillowBiter wrote: And I'm a fucking retard:

And yet again.

$query = "CREATE TABLE `rss` (
`id` INT( 11 ) NOT NULL ,
`title` VARCHAR( 255 ) NOT NULL ,
`link` VARCHAR( 255 ) NOT NULL ,
`description` LONGTEXT NOT NULL ,
`pubDate` VARCHAR( 255 ) NOT NULL
) TYPE = MYISAM";
if(!$query) {
die(mysql_error());

what is this? checking to see if the $query variable has a value to see if the query went through. I think you should have done this, don't you agree?:

if ( !($sql = mysql_query( $query)) ) {
die(mysql_error());

Honest mistake. I have done it loads of times before myself. Kinda wonder why though, isn't this error so obvious when reading it in someone elses code?

Newgrounds should employ code tags.

Agreed.

I didn't overly like that tutorial. For one the HTML was hard on my eyes. I didn't like looking at it how it was layed out. and I just didn't like the writting for some reason. No offence.

Taylor
Taylor
  • Member since: Aug. 19, 2003
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Php: Rss Feed Creaton 2005-12-18 16:37:38 Reply

Craige, you're way wrong too =P
I just didn't do it right for some odd reason. No variables should be used, it should be
mysql_query "query" or die(mysql_error());
Or operator is more secure than assining a variable.

Craige
Craige
  • Member since: Jul. 17, 2004
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Php: Rss Feed Creaton 2005-12-18 16:43:41 Reply

At 12/18/05 04:37 PM, PillowBiter wrote: Craige, you're way wrong too =P
I just didn't do it right for some odd reason. No variables should be used, it should be
mysql_query "query" or die(mysql_error());
Or operator is more secure than assining a variable.

well the variable isn't needed for this query. I just have a habit of doing that cause of always using the select query, and having to use the variable later. But the mysql_query( query ) or die( mysql_error() ); method is more secure.

elbekko
elbekko
  • Member since: Jul. 23, 2004
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to Php: Rss Feed Creaton 2005-12-18 16:52:57 Reply

Yes, I know the layout didn't work out quite right...

And what's wrong with the text?


"My software never has bugs. It just develops random features. " - Unknown

[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]

BBS Signature
Craige
Craige
  • Member since: Jul. 17, 2004
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Php: Rss Feed Creaton 2005-12-18 17:27:50 Reply

At 12/18/05 04:52 PM, elbekko wrote: Yes, I know the layout didn't work out quite right...

And what's wrong with the text?

It is hard to put a finger on single things, but for example:

I'm using mysql_result here, because, for some odd reason, mysql_fetch_array wouldn't work.

That dosn't sound so good when you are saposed to be teaching someone somthing. Generally though, it is just a conbonation of the text to me. It may have a somthing to do with the fact I have a headache, and the way the text is broken on the page, but for some reasion I just didn't like it too much. Sorry. If others like it though, good for them, and I am glad for you.

elbekko
elbekko
  • Member since: Jul. 23, 2004
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to Php: Rss Feed Creaton 2005-12-19 06:34:34 Reply

I'm just spreading my knowledge :)

I'll rewrite it soon now I have some time on my hands again :)


"My software never has bugs. It just develops random features. " - Unknown

[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]

BBS Signature
RWS
RWS
  • Member since: Mar. 11, 2005
  • Offline.
Forum Stats
Member
Level 23
Blank Slate
Response to Php: Rss Feed Creaton 2005-12-19 06:50:14 Reply

I made a tutorial on this very same subject, not so long ago, except my tutorial was on FlashTroops

http://www.flashtroo..forum/viewthread/106