Jump to content

fonster_mox

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

About fonster_mox

  • Birthday 12/04/1986

Profile Information

  • Gender
    Male

fonster_mox's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry I dont' think I explained my problem very well, I already have sorted them, well I sorted them by id which is an auto incrementing number which essentially does the same thing. What I would like is sort of an archive webpage, where the php generates a list of months, and clicking on a month would take you to all posts from that month.
  2. Hi, I do not know any php, just wanted to clear that up first! I have a mysql database with the following fields: datetime, title, body and id. Where datetime is automatically inputted in the format $datetime = date ("Y-m-d H:i:s"); What I would like now is a .php code which lists all months (eg, May 2009, June 2009) if they are present and then when you click on a month, you echo all news entries from that month, much like this - or possibly using a drop down box. As I said I don't really know php so I don't know where to start, can anybody help me with the code or perhaps point me in the right direction? Would be much appreciated, thanks for reading
  3. I take that back (sorry to double post, but modify has gone, I assume it's on a timer). I did figure it out, thank you! It was thanks to being swerved back to that GET code. I had googled previously and thought GET was what I needed, but couldn't get it right. In the end, your insistence and a bit of trial and error proved me wrong. All I needed was $id=$_GET['id']; above $news=mysql_query("select * from news WHERE id='$id' ORDER BY id DESC LIMIT 1") or die ("cant get table"); Thanks again, consider this solved and closable
  4. I've tried using this page but I still can't figure it out. I appreciate that you're trying to get me to help myself but I don't even understand most of the code I have so far (a friend helped me through it, who's on holiday now). To fix my own problem using the link you've provided would mean going back a few dozen steps to learn some basics first, which I don't really have time for. But I'm quite sure if someone just showed me what I'm missing (I'm sure it's very easy for someone with experience, it's a very basic news post system linking to a full size article, the site you can find on thousands of sites already), I'm sure I would learn a lot from it. Thanks, anyway
  5. It isn't, I know but that's my problem, I don't know what I'm supposed to define it as (seriously new to php )
  6. Hi, I'm very new to php so I don't really know what I am doing. I am recieving the message Notice: Undefined variable: row in /mysite.com/article.php on line 62 I know this is because I haven't defined $row but I don't know what it's supposed to be defined as, or where as I said, very new to php! the page is supposed to get the id from the url, eg article.php?=10 should post only the row of the table with the id 10. <? $id=$row["id"]; $db=mysql_connect("localhost","*****","*****") or die ('cant connect'); mysql_select_db("*****",$db) or die ("cant change"); $news=mysql_query("select * from news WHERE id='$id' ORDER BY id DESC LIMIT 1") or die ("cant get table"); while($rows=mysql_fetch_array($news)){ $body=$rows["body"]; $title=$rows["title"]; $date=$rows["date"]; $author=$rows["author"]; $email=$rows["email"]; $smallcontent=$rows["smallcontent"]; echo "<div class=\"newsitem\"> <div class=\"newstop\"></div> <div class=\"newsmiddle\"> <div class=\"innernews\"> <span class=\"newshead\">$title</span><br /> <span class=\"byline\">By <a href=\"mailto:$email\">$author</a> on $date</span><br /><br /> $body <br /><br /> </div> </div> <div class=\"newsbottom\"></div> </div>"; } ?> would be really grateful with an explanation of what I've done wrong or just the correct way to do it, thanks, fonmo.
×
×
  • 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.