Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Feb 2003
    Posts
    15
    Member #
    609
    HI ya everybody,

    I've a very big task before me and i aint sure how shld i do this one??I display records from a table and i want to print the date on each record.To be more precisely, I display for example 20 records(with rec_id 1 to 20) everyday.First few records will have todays date and next few records will have yesterdays date and so on.Tomorrow, I display 20 more records(with rec_id 21 to 40).So everyday, I need to show that days date on the first few records and the previous date and so on.
    I would be glad if somebody can help me.
    Many many thanks

    Heres the code how i display my records everyday.Here i need to append the code for my date concept.Please help me
    PHP Code:
    //Lets get the weekday 
        
    $today getdate();  
        
    $day $today['weekday']; 
    //Lets Select the records from the table based on the weekday   
    switch($day)  
    {  
    case 
    "Monday":  
        
    $query="SELECT id,introtext,zipcode,image,telephone,description FROM tbl_personals ORDER BY id Limit 20";  

        
    $numresults=mysql_query($query,$connection);  
        
    $numrows=mysql_num_rows($numresults); 
    break;  
    // and so on with the other week days. 
    }  
    // We carry out the table population using a 'while' loop 

        
    while ($row=mysql_fetch_array($result))  
        {  
        
    $var_7=$row["id"]; 
        
    $var_1=$row["introtext"];  
        
    $var_2=$row["zipcode"];  
        
    $var_3=$row["image"];  
        
    $var_4=$row["telephone"];  
        
    $var_6=$row["description"];  
    // Display the results 

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    What does the date correspond to? If you're showing recently added personal ads, you should store "date_created" as a field in the table. That way, you can retrieve the top 20, ORDER BY date_created DESC, and display the date_created as one of the fields you're displaying.

    Also, that way, you're displaying actual data rather than making up dates as you go along. Furthermore, you are storing an additional piece of data about your records. Better all around!

  4. #3
    Junior Member
    Join Date
    Feb 2003
    Posts
    15
    Member #
    609
    Yes thats true if i had a "date_created" field in the table and that would make my life easier.But, thats not the way i really want to do.well, heres a breif explanation about why i wanting to do in that way..........
    I'm listing all the profiles of women and men on a page.Everyday, i show, say 20 profiles.I've a list of some 100 profiles.I insert all these profiles on the same day in the database.So, If i have a date_inserted field in the table, then all the profiles would show the same date.It would be fine for the first day, but if the same user visits these pages everyday and if he sees the same date everyday, it would be really not interesting for the user to visit.So, what I want to do is, the first few records should have todays date and the next few with yesterdays date and so on.....
    Ane one more important thing is,I dont want to show the date on same number of records everyday.i.e, if i show todaysdate on 4 records today and i would like to show the date on 6 records tomorrow.So, that would create an impression that not the same number of new profiles are shown everyday.

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    You shouldn't do it that way. That's called smoke and mirrors, and it will bite you in the arse in the long run. I understand that you want it to look like you've got more members than you really have, but you're basing your concept on your members' stupidity.

    People are smarter than you might think, and they will catch on. You're also showing information that is high-retention (photographs and singles' profiles). They will see a new profile... then come back 5 days later and see the same "new" profile. Then they will never come back again.

    The best way to "market" your company is to be honest with your prospective members. Tell them you're new. Tell them exactly how many members you have. Tell them that you're growing. Tell them how many new members you got that day. That week. That month. Use the figures that seem as impressive as you can, but be honest.

  6. #5
    Junior Member
    Join Date
    Feb 2003
    Posts
    15
    Member #
    609
    Transio,
    [[OFF TOPIC]
    Honestly, I neither have a company nor a portal to promote these pages which I'm working on.One of my friend has asked me to check if this is possible to do, becuase he wants to advertise it somewhere and see if it has got any benifits.I dunno whats in his mind.So, please dont mis-understand me.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:41 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com