0
$query = "SELECT * FROM `status_info_private` WHERE `id`=$id ORDER BY `Status_Date` DESC LIMIT 100";
if ($query_run = mysql_query($query)) {
    while ($rows = mysql_fetch_array($query_run)) {
        echo '<a href="view_profile.php?id=' . $id . '"><font color="#009900" > ' . $rows['Name'] . ' ' . ' Says :' . '</font></a><br/>';
        echo '<p align="justify> ' . $rows['Private_status'] . '<br/>';
        echo '<p align="right">' . $rows['Status_Date'] . '<br/>';
        $like   = $rows['Like'];
        $unlike = $rows['Unlike'];
    }
}

I think everything is correct in the piece of code. But still I am unable to get the output under the column titled as "Private_status". The above code is producing everything correctly except the message under cols "Private_status". I have already checked the spelling of the col name & there is no error in that part. So, Please tell me what exactly is missing ?

6
  • 1
    <font> is deprecated. As well as align= attribute on the <p> element. Please learn about CSS. Commented Nov 3, 2012 at 10:30
  • 3
    can you place print_r($rows) in while loop and get us the result? Commented Nov 3, 2012 at 10:31
  • Also, what is the output you're getting, and what are you expecting? Commented Nov 3, 2012 at 10:31
  • 1
    @ Madara Uchiha I am not an expert in CSS but i am sure we can use align attribute in <p> element. By the way problem is not styling... Commented Nov 3, 2012 at 10:34
  • we understand that the problem is not styling but there is no harm in getting good things.. Commented Nov 3, 2012 at 10:37

2 Answers 2

1

first close your <p> tags and then do a print_r to check what is in $rows .. Also, start using PDO or mysqli

Sign up to request clarification or add additional context in comments.

1 Comment

closing of the <p> tags is not a problem. Since <p> is a singular tag.
0
$query = "SELECT * FROM `status_info_private` WHERE `id`=$id ORDER BY `Status_Date` DESC LIMIT 100";
if ($query_run = mysql_query($query)) {
    while ($rows = mysql_fetch_array($query_run)) {
        echo '<a href="view_profile.php?id=' . $id . '" color="#009900" > ' . $rows['Name'] . ' ' . ' Says :' . '</a><br/>';
        echo '<p align="justify"> ' . $rows['Private_status'] . '</p>';
        echo '<p align="right">' . $rows['Status_Date'] . '</p>';
        $like   = $rows['Like'];
        $unlike = $rows['Unlike'];
    }
}

1 Comment

:- Still not working. As i have already mentioned styling is not a problem in extraction of data from the database. By the way thanx for your help...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.