Jump to content

neo926

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

neo926's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That did the trick! That's fantastic, thank you very much! On a side note, would my problem have anything to do with whether my site is running php4 or php5? Right now it's running php4, but I believe I have the option to change to php5. Again, thanks a lot.
  2. No, I don't think it's a short tag issue. I've enable short tags in php.ini, as well as tries just using regular <?php tags, doesn't seem to matter.
  3. I have an RSS feed for my site that pulls data from my MySQL database, so since it's an XML file and uses PHP in it, I have added AddType application/x-httpd-php .xml So that the XML file displays properly. Well, that's been working fine until about a month ago. Our server crashed and our web host had to rebuild it. Well, when they rebuilt it, the XML file no longer displays properly. We actually just moved to a new webhost, but I still seem to be having the same problems. Basically the PHP code in the file isn't being parsed at all. For example: http://secondcitysaint.com.s60090.gridserver.com/rss2.php Here's the code with a .php extension. Works fine. http://secondcitysaint.com.s60090.gridserver.com/rss2.xml But when I change it to a .xml extension, it doesn't work at all. My .htaccess file is correct as far as I know, and as I've said, it used to work, for years, I didn't change anything, but clearly something got screwed up somewhere, and I don't have a clue what it could be. I know that ultimately I could just change my RSS feed to point to the .php extension, but all of my readers already subscribe to the .xml file, so I'd rather not do that if at all possible. Any help would be appreciated.
  4. Well, I'd be more than happy to just pull the year from my submitted column, but I don't know how to do that, since it's in DATE_TIME format.
  5. It works fine without the WHERE clause, it's just when I add it in
  6. I did, the second code box. Here's the full message: Error SQL query: Documentation SELECT DISTINCT ( DATE_FORMAT( submitted, '%M' ) ) AS mymonth, DATE_FORMAT( submitted, '%Y' ) AS myyear, title FROM secondcitysaint WHERE myyear = '2007' ORDER BY submitted DESC LIMIT 0 , 30 MySQL said: Documentation #1054 - Unknown column 'myyear' in 'where clause'
  7. Sorry, I'm using SQL 4.1
  8. SELECT DISTINCT(DATE_FORMAT(submitted,'%M')) AS mymonth , DATE_FORMAT(submitted,'%Y') AS myyear , title FROM secondcitysaint WHERE myyear = '2007' ORDER BY submitted DESC #1054 - Unknown column 'myyear' in 'where clause' I created this temporary column called 'myyear' with the AS function above, and I want to pull data based on a certain year that's listed in the 'myyear' column, but MySQL tells me the column isn't there. Is there a way I can fix this?
  9. [quote author=thorpe link=topic=101190.msg400407#msg400407 date=1153402486] [quote]Go here for RSS & XML reader source code..[/quote] He is creating a feed, not a feed reader. What file extension does this file have? In order to parse the php it'll either need the .php extension, or you'll need to setup your server to parse .xml as php. [/quote] I had it as an .xml file.  What do I need to do to parse .xml as php?
  10. Did I post this in the wrong forum?
  11. So, I'm creating an RSS feed for a site.  It includes PHP code, as it pulls all the latest articles from the site's MySQL database when creating the feed.  However, when I display the XML file, it hasn't processed any of the PHP code I have in the feed.  Basically, my code looks like this: [code]<?php header('Content-type: text/xml'); ?> <rss version="2.0"> <channel> <title>Title</title> <description>Description</description> <link>http://link.com/</link> <copyright>All material copyright 2006 their respective owners</copyright> <?php PHP code pulls data from db ?>     <item>         <title> <?php echo $myrow['title']; ?></title>         <description> <?php echo $myrow['teaser']; ?></description>         <link>http://link.com/index.php?id=<?php echo $myrow['id']; ?></link>     </item>    <?php } ?> </channel> </rss> [/code] Now, I know this feed works, as it's basically the same code I have on a different site, and there are no problems displaying the RSS feed.  On this site, however, when you click on the XML link, it takes you to the XML page, only all the PHP code is sitting there, completely unparsed. Is there something the site's server might not be capable of doing that is causing this problem?  Or am I not including something I should be?  Help!
  12. So, I have a sports writing site. I have a form set up for my writers so they can submit their columns (Title, Column content, etc.). The data input is processed and submitted to my MySQL database. The problem with this is that the writers can't see what the final product is going to look like on the mainpage, to make sure they have everything formatted properly. I want to add a button next to the 'submit' button that will open up a new page that will process the data and display it on a preview page, so they know how it's going to look on the mainpage. I don't know how to do this. I already have the form set up like this: [code]<form method="post" action="<?php echo $PHP_SELF ?>">[/code] So I don't know how I can redirect the form information into this new page to preview the data using a preview button instead of submitting the data to the database. Any help would be appreciated.
  13. You have totally just jumped about 1,000 spots up on my 'Cool' list. Outstanding! Thank you so much!
  14. What a fun topic name that is. Okay, this is the last big challenge for me and my site. As I've said in my earlier threads, I have a db that contains columns that are posted for a sports site. One of the fields in my table that contains the column information is the specific sport being written about. Another field contains the name of the author of the column. So, what I would like to do is query the db to achieve the following display result: Table contains: Sport Author NFL Mark MLB Joe NFL Matt NBA John MLB Steve Query displays: NFL Mark Matt MLB Joe Steve NBA John Now I know I can use the SELECT DISTINCT(sport) to display each sport individually. But can this be used in conjunction somehow with another function to get the names of the authors of said sport to display underneath? I would appreciate any help on this matter.
  15. Well, I actually had two problems. The first was, in fact, a query error. The other problem was due to the fact that the table I was trying to access was named 'columns', which I learned is a flagged word, and I had to put it in ' ' for the code to process properly.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.