I will pay 5$ for adding simple code on my script

Discussion in 'PHP' started by alllyc, Oct 31, 2009.

  1. #1
    Hi all,

    I got very confused on a script that I asked someone to write it for me. It is very simple script which is about adding news and displaying them on the index page. Currently it shows only 3 news, and I want it to show 5 or 7 news on the index page. PM me if you are interested, I will send you the details and the script. As far as I know, it is very simple cus the person who wrote that script change it from displaying 5 news to 3 news so fast. (I dont believe it will take 5 mins) I guess what he did was to find the number 5 on the index.php and change to 3. I am quite sure it was like this. I will pay you via paypal.
     
    Last edited: Oct 31, 2009
    alllyc, Oct 31, 2009 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    You can get it for free if you post your code.
     
    nico_swd, Oct 31, 2009 IP
  3. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #3
    yup, i agree with nico_swd.

    Post code and we can help you get it done for free :)
     
    mastermunj, Oct 31, 2009 IP
  4. alllyc

    alllyc Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The code is below:
    It shows only 3 news like in this link HERE
    I want it to show 5 news. When I change the below code's order by id desc limit 2 "; to limit 4 it shows 5 news but last 4 news on the same raw. I wanna see 2 news in one raw and the other 2 news under it.
    $sqllist="select * from demirtepe where id < $list[id] and durum=0 order by id desc limit 2 ";

    Thanks a lot for your helping
     
    alllyc, Oct 31, 2009 IP
  5. astrazone

    astrazone Member

    Messages:
    358
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #5
    you need to change the table for your needs.

    you need 2 news posts in each <tr>.
     
    Last edited: Oct 31, 2009
    astrazone, Oct 31, 2009 IP
  6. xenon2010

    xenon2010 Peon

    Messages:
    237
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    simple change
    $sqllist="select * from demirtepe where id < $list[id] and durum=0 order by id desc limit 2 "
    PHP:
    to
    $myvalue = "5"; //the number you want
    $sqllist="select * from demirtepe where id < $list[id] and durum=0 order by id desc limit  $myvalue";
    PHP:
     
    xenon2010, Oct 31, 2009 IP
  7. astrazone

    astrazone Member

    Messages:
    358
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #7
    thats not the problem... as he said, he gets them all in a row but he needs them 2 in a row and in 3 columns.
     
    astrazone, Oct 31, 2009 IP
  8. alllyc

    alllyc Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Hi,

    Thanks a lot for everyone who tried to help me out on that problem.

    The problem is solved with this code and thread might be closed.

    $sqllist="select * from demirtepe where id < $list[id] and durum=0 order by id desc limit 2,2 ";
     
    alllyc, Nov 1, 2009 IP
  9. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #9
    Just some critism on your coding 'style';
    $sqllist = "SELECT * FROM `demirtepe` WHERE `id` < '$list[id]' AND `durum` = '0' ORDER BY `id` DESC LIMIT 2,2 "; 
    Code (markup):
    Will help you enormous when you look at your code at a later stage.
     
    Sky AK47, Nov 2, 2009 IP