Fetch Data from Database?

Discussion in 'PHP' started by sumitt_2004, May 16, 2008.

  1. #1
    Hi,

    1) I am facing a problem while fetching data from database. All data fetch except first record. I am using this coding.

    $sql = "select * from meta";
    $i=0;
    while($row = mysql_fetch_query($sql))
    {
    echo"<td>".$row.['id']."</td>";
    echo"<td>".$row.['Title']."</td>";
    echo"<td>".$row.['Description']."</td>";
    echo"<td>".$row.['Keywords']."</td>";
    }


    2) I want to add a date column in my database in which, I want current date (either modification or insert). But it will not be system dependent like if, I edit my pc clock after that it will take right date.

    Please help me give solution of above problems.
     
    sumitt_2004, May 16, 2008 IP
  2. sumitt_2004

    sumitt_2004 Peon

    Messages:
    154
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    1) Problem is resolved. It is due to my fault coz, I already fetched first record before loop. But still, I am waiting for 2) problem solution.
     
    sumitt_2004, May 16, 2008 IP
  3. roshanbh

    roshanbh Peon

    Messages:
    52
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    well the second one is not problem.......since in local development you can change the pc's clock but in server it doesn't applies.....
     
    roshanbh, May 16, 2008 IP
  4. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #4
    Your PC clock has nothing to do with it; it will be based on the system time on your server.
     
    itcn, May 16, 2008 IP