Jump to content

Random 'array' Echo


Swarfega

Recommended Posts

Hey.

 

 

I've just setup the Comment-Part of my custom-scripted Foto Album system, and it's working properly, apart from one issue which I simply cannot find in the while loop. Either it's something easy and I'm missing it or there's something hidden that I can't find.

 

 

When I mean "Random 'Array' Echo" I don't mean an actual Array Printing data, what I mean is that the word 'Array' itself is printed.

 

 

Here's what happens without a comment:

 

http://i.imgur.com/NNbFy.png

 

 

Here's what happens with a comment:

 

http://i.imgur.com/16mbM.png

 

 

And here's the code processing the Data:

 

$sql = "SELECT * FROM imagecomments WHERE imageid='".$_GET['imageid']."' AND targetid='".$_GET['targetid']."' ORDER BY UNIX_TIMESTAMP(timehappen) DESC LIMIT ".$min.", ".$limit;
$query = mysql_query( $sql );
$rows = mysql_num_rows( $query );

while($row = mysql_fetch_array($query))
{

$data .= "<tr>";
if($durp == 0) {
$data .= "<td class='cellone'><img src='".$row['profilepic']."' ></td>";
} else {
$data .= "<td class='celltwo'><img src='".$row['profilepic']."' ></td>";
}
if($row['connected'] == "online") {
if($durp == 0) {
$data .= "<td class='cellone' style='max-width: 600px; overflow:auto; word-wrap:break-word;'><img src='online.png' width='5' height='5'> <a href='profile.php?uid=".$row['uid']."'>" . ucfirst($row['sender']) . "</a> - <font color='green'>". $row['timehappen'] . "</font> <br/> ".$row['message']."</td>";
$durp = 1;
} else {
$data .= "<td class='celltwo' style='max-width: 600px; overflow:auto; word-wrap:break-word;'><img src='online.png' width='5' height='5'> <a href='profile.php?uid=".$row['uid']."'>" . ucfirst($row['sender']) . "</a> - <font color='green'>". $row['timehappen'] . "</font> <br/> ".$row['message']."</td>";
$durp = 0;
}
} else {
if($durp == 0) {
$data .= "<td class='cellone' style='max-width: 600px; overflow:auto; word-wrap:break-word;'><img src='offline.png' width='5' height='5'> <a href='profile.php?uid=".$row['uid']."'>" . ucfirst($row['sender']) . "</a> - <font color='red'>". $row['timehappen'] . "</font> <br/> ".$row['message']."</td>";
$durp = 1;
} else {
$data .= "<td class='celltwo' style='max-width: 600px; overflow:auto; word-wrap:break-word;'><img src='offline.png' width='5' height='5'> <a href='profile.php?uid=".$row['uid']."'>" . ucfirst($row['sender']) . "</a> - <font color='red'>". $row['timehappen'] . "</font> <br/> ".$row['message']."</td>";
$durp = 0;
}
}
$data .= "</tr>";
}

echo $table1_start . $table_start . $data . $table_end . $table1_end;

 

 

I know the code itself is very sloppy, but I tend to fix that after everything's already working properly, which currently it is not. I have spent hell of a lot of time trying to find out why it's printing the 'Array' Text/String, but I can't find it. It's evidentally in the $data value but I can't find where.

 

 

Edit: I'm also using the same Data-Printing system for the User-Individual Guestbooks & the Chat System, and they all work properly, apart from this 'Array' echoing.

Edited by Swarfega
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.