Results 1 to 4 of 4
  1. #1

    Need Some Help by a PHP Expert

    PHP Code:
    function blogs($period="current")
        if (
            if (
    $bloghistory=$_GET["history"]<=$_GET["history"] : 5;
    // because MySQL does not support sub selects...
    mysql_query("create temporary table datetemp (dates varchar(25) NOT NULL) type=myisam") or die(mysql_error());
    mysql_query("insert into datetemp (dates) select distinct date_format(dateentered,'%Y-%m-%d') as entrydate from blog_entries where active=1 and pinned=0 order by entrydate desc limit $bloghistory") or die(mysql_error());
    $query="select be.blogid,be.preview,be.entry,be.dateentered,be.title,be.pageviews,be.usepreview,,be.pinned from blog_entries be,datetemp inner join blog_authors ba on be.authorid=ba.authorid where date_format(be.dateentered,'%Y-%m-%d')=datetemp.dates and and be.pinned=0 order by be.dateentered desc";
        elseif (
    $query="select be.blogid,be.preview,be.entry,be.dateentered,be.title,be.pageviews,be.usepreview,,be.pinned from blog_entries be inner join blog_authors ba on be.authorid=ba.authorid where catid=$catid and order by be.dateentered desc";
    $query="select be.blogid,be.preview,be.entry,be.dateentered,be.title,be.pageviews,be.usepreview,,be.pinned from blog_entries be inner join blog_authors ba on be.authorid=ba.authorid where date_format(be.dateentered,'%Y-%m')='$period' and order by be.dateentered desc";

    It's all about the Coupons and the Coupon Codes

  2. #2
    Now, basicaly I have a program i can add more releveant code if necessary, this program lets me depending on the 5 values that are sent to it show the blog entries for up to 5 days, 4, days, 3 days, 2 days, or just one day (which is default)

    I want to adjust this so that it shows the last 10 enties, last 20 entries, last 30 entries or last 40 entries, instead of show them on a daily basis.

    So can anyone suggest whay I have to change for this script to work?

    It's all about the Coupons and the Coupon Codes

  3. #3
    Join Date
    May 2002
    In the SQL query simply use

    LIMIT 0,10
    LIMIT 0,20
    LIMIT 0,30
    LIMIT 0,40

  4. #4
    what exactly would i change in the php code?

    depedning on the var it changed

    ie. index.php?history=1

    so where on the code would i modify?

    It's all about the Coupons and the Coupon Codes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts