I got a foreach-loop, but want to show one echo next to one specific post, while the rest shows to every loop-element.
I got that far:
$query = mysql_query ($query); (this also gets a post_id)
$data = array();
while($row = mysql_fetch_array($query)){
$data[] = $row;
foreach ($data as $row):
echo "Date", "post", "vote";
I now dont want the vote to be shown, in just one special row, if
$row = $query_row[0].
I tried
$query_row= ( find the post_id of the row, where the user voted)
if ($row['post_id'] == $query_row[0]) {
echo 'u voted';}
else {
echo 'vote';
}
Unfortunately, this would show up under every post, not just the post, where the user voted. Any ideas, how to echo “u voted”, under just this one post_id?
Perhaps you meant to say something like
The sample code you provide is incomplete though, so it isn’t clear what’s what…