0

Hello i want to create a countdown with numbers
for example

  1. (some data from database)
  2. (some data from database)
  3. (some data from database)
  4. (some data from database)
  5. (some data from database)
    and so on....

I have done the ORDER BY and retreive the data i want from the database. but i dont know how to put the numbers countdown. Any idea? or link?

3
Contributors
13
Replies
39
Views
2 Years
Discussion Span
Last Post by SimonIoa
Featured Replies
  • 1

    That's what the variable is for. Read More

  • 1

    $count = 1; foreach ($chartarray as $datachart) { $chart_message= $datachart['message']; $chart_description = $datacharta['description']; $chart_type = $datachart['type']; $chart_uploads=$datachart['uploads']; $chart_msg_id = $datachart['msg_id']; $chart_views = $datachart['views_count']; $chart_venue = $datachart['venue']; $chart_dategig = $datachart['dategig']; $s = explode(",", $media_uploads); $p= $s[0]; $r = $s[1]; $img = $base_url . "icons/number-$count.png"; $count++; } Read More

0
    foreach (....)
    {
    echo '
    <table>
        <tr>
            <td>
                <a href="'localhost/project/'.$id.'" >
                    <img src="'.$face.'" class="small_face" original-title="'.$chart_message.'" >
                </a>
            </td>
            <td>
                <a  href="'localhost/project/'.$id.'" >'.$title.'</a>'.$views.'
            </td>
        </tr>
    </table>';
    }

Edited by SimonIoa: better

0

i want the numbers to be images
for example

1 as image
2 as another image
3 as other image
and so on

0

Please show a more complete code, based on the code provided, we cant even know where your variables getting data from. What I can see from your code, there is problem with <a href="'localhost/project/'.$id.'" >

0

sorry my laptop broke down. Cant do anything. Anyway there's nothing wrong with code. It works i just want to add an image of each number(1,2,3,4 etc) at the left of each <img src="'.$face.'" class="small_face" original-title="'.$chart_message.'" >

0

Then just add another <img src="/path/$idx.png" /> or whatever. Define $idx before the foreach and increment before the end of the loop.

0
$chartarray=$Wall->Chart_Audio();
if($chartarray)
{
    foreach ($chartarray as $datachart)
    {
    $chart_message= $datachart['message'];
    $chart_description = $datacharta['description'];
    $chart_type = $datachart['type'];
    $chart_uploads=$datachart['uploads'];
    $chart_msg_id = $datachart['msg_id'];
    $chart_views = $datachart['views_count'];
    $chart_venue = $datachart['venue'];
    $chart_dategig = $datachart['dategig'];
    $s = explode(",", $media_uploads);
    $p= $s[0];
    $r = $s[1];

    **$img = $base_url.'icons/number-1.png';**


    }
    echo '
    <table>
    <tr>
    <td rowspan="2">
    **<img src="'.$img.'"  class="small_face" />**
    </td>
    <td rowspan="2">
    <a href="'.$base_url.'roves/'.$chart_msg_id.'" >
    <img src="'.$rove_face.'" class="small_face" >
    </a>
    </td>
    <td>
    '.$chart_message.'
    </td>
    </tr>
    <td>
    <label>'.$chart_views.' views</label>
    </td>
    </tr>
    </table><br>';
    }
}
?>

Edited by SimonIoa: edit

1
$count = 1;
foreach ($chartarray as $datachart)
{
    $chart_message= $datachart['message'];
    $chart_description = $datacharta['description'];
    $chart_type = $datachart['type'];
    $chart_uploads=$datachart['uploads'];
    $chart_msg_id = $datachart['msg_id'];
    $chart_views = $datachart['views_count'];
    $chart_venue = $datachart['venue'];
    $chart_dategig = $datachart['dategig'];
    $s = explode(",", $media_uploads);
    $p= $s[0];
    $r = $s[1];

    $img = $base_url . "icons/number-$count.png";
    $count++;
}
0

oh man that was simple as.... My mind didnt go that i could use the +1 to call the path for the image. Thanks a lot.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.