cwarn23 387 Occupation: Genius Team Colleague Featured Poster

That error means that you did some html or text output to the browser before the header function. So make sure there is no text output (eg echo function) before the header function.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try replacing the meta on line 10 with the following:

header('Location: '.$HTTP_SERVER_VARS['PHP_SELF'].'?id='$orderID); exit();
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

To limit it to 4 records then in addition to what I said before do the following sql query as well.

$query_latestJobPost = "SELECT * FROM tbljobad ORDER BY postDate DESC LIMIT 4";
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

try this:

<table>
			<?php while($assoc_latestJobPost = mysql_fetch_assoc($latestJobPost)) { ?>
			<tr>
				<td><?php echo $assoc_latestJobPost['jobTitle']; ?></td>
				<td><?php echo $assoc_latestJobPost['jobCategoryID']; ?></td>
				<td><?php echo $assoc_latestJobPost['postDate']; ?></td>
				<td><?php echo $assoc_latestJobPost['employerID']; ?></td>
			</tr>
			<?php } ?> 
</table>

where $latestJobPost being assigned by the mysql_query() function.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Why you don't agree with Will?

Because if the sha1 and md5 algorithms are cracked then the entire salt and encryption Will suggested can be cracked. However with my method part of the original hash has been destroyed with substr and you would need a lot of guess work before getting the decoded result. So therefore mine is more secure.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I agree with Gresham but beg to defer on the code an not concept.
Example:

function truehash($input) {
return hash('sha1',substr(hash('sha1',$input),4,-4).hash('crc32',$input));
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try this:

// code to generate drop down box
		$query="SELECT title FROM content ORDER BY title ASC";
		$result = mysql_query ($query);
		echo "<select name=title value=''>Title</option>";

		while($nt=mysql_fetch_array($result)){
		echo "<option value=\"$nt[title]\">$nt[title]</option>";
		}
		echo "</select>";
				
//on the next page where its deleted the code is...
// we have something to delete
   	$SQLcmd = "DELETE FROM content WHERE title = '$title'";
 	mysql_query($SQLcmd, $con);
   
	// but did we delete anything....
   	if (mysql_affected_rows() == 0) {
      	echo "<p><font color=#C11B17>You were unsuccessful in deleting the information you requested! Please try again...</font></p>";
   		}
   		else 	{
      		echo "<p>**The information has been successfully deleted**</p>";
	}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

$user = stripslashes($_POST["user"]);
$dirname = "./cp/userfiles/$user/"; 
 
if (is_dir($dirname)) {    
echo "The directory $user exists";    
} else {    
mkdir("userfiles/$user", 0777);    
echo "The directory $user was successfully created.";    
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

This should be made a sticky. It means there is html or binary output before the function session_start(). Some IDE's put a binary code at the beginning of the file causing this error but one of the more common reasons is that you have some white spacing just before the <?php on line 1. So make sure there isn't even a space before the <?php.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

So what exactly is the problem. I see on line 2 you need to add the second quote into the function input but other than that the code looks fine. Could you please explain what the question is as I see a pretty script with a description but no mention on any problems.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Good to hear. Could you please mark this thread as solved by clicking the solved link as it gives others on the topic credit and shows the status as solved in the forum.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

That error normally indicates that there is a missing curly backet { or } but according to the code I posted it looks like it's all there. Perhaps when you copied and paste you missed the last two lines? Is that true?

[Edit]
I guess in your mistake your forgot to place one of the brackets.
[/Edit]

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following.

<?php
include ("dbConfig.php");
require ("check.php");

if($_GET["cmd"]=="edit" || $_POST["cmd"]=="edit")
{
   if (!isset($_POST["submit"]))
   {
      $id2 = $_GET["id2"];
      $sql = "SELECT * FROM contacts WHERE id2=$id2";
      $result = mysql_query($sql);        
      $myrow = mysql_fetch_array($result);
      ?>
	  
      <form action="<?php $v=explode('?',$_SERVER['PHP_SELF']); echo $v[0]; ?>" method="post">
      <input type=hidden name="id2" value="<?php echo $myrow["id2"]; ?>">
   
      Name:<INPUT TYPE="text" NAME="name" VALUE="<?php echo $myrow["name"]; ?>" SIZE=30><br>
      Email:<INPUT TYPE="text" NAME="email" VALUE="<?php echo $myrow["email"]; ?>" SIZE=30><br>
      Who:<INPUT TYPE="text" NAME="age" VALUE="<?php echo $myrow["age"]; ?>" SIZE=30><br>
      Birthday:<INPUT TYPE="text" NAME="birthday" VALUE="<?php echo $myrow["birthday"]; ?>" SIZE=30><br>
      Address:<TEXTAREA NAME="address" ROWS=10 COLS=30><?php echo $myrow["address"]; ?></TEXTAREA><br>
      Number:<INPUT TYPE="text" NAME="number" VALUE="<?php echo $myrow["number"]; ?>" SIZE=30><br>
   
      <input type="hidden" name="cmd" value="edit">
   
      <input type="submit" name="submit" value="submit">
   
      </form>
      
<?php      
   }
}
   if (isset($_POST['submit'])) {
   	  $id2 = mysql_real_escape_string(stripslashes($_POST["id2"]));
      $name = mysql_real_escape_string(stripslashes($_POST["name"]));
	  $email = mysql_real_escape_string(stripslashes($_POST["email"]));
	  $age = mysql_real_escape_string(stripslashes($_POST["age"]));
	  $birthday = mysql_real_escape_string(stripslashes($_POST["birthday"]));
	  $address = mysql_real_escape_string(stripslashes($_POST["address"]));
	  $number = mysql_real_escape_string(stripslashes($_POST["number"]));
 
	  $sql = "UPDATE contacts SET name='$name', email='$email', age='$age', birthday='$birthday', address='$address', number='$number' WHERE id2=$id2";
 
      $result = mysql_query($sql) or die(mysql_error());
      echo "Thank you! Information updated.";
	}
?>
kunyomi commented: Patient and just simply genius! +1
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I changed to position of some brackets and fixed the php short tags. Also fixed some echo bugs for future versions of php. I also prevented sql injections. Fixed the additional slashes from being inserted into the mysql database. Also make parts of the code look pretty. And made the form to post to the the same php file the user is currently viewing.

So does that all work or are there still errors?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

This gives me an error. You took away the

<? } ?>
<?php

at line 32 to 33 right?

It renders the php code below useless. Hmm.

Oops, line 31 needs <?php

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following.

<?
include ("dbConfig.php");
require ("check.php");

if($_GET["cmd"]=="edit" || $_POST["cmd"]=="edit")
{
   if (!isset($_POST["submit"]))
   {
      $id2 = $_GET["id2"];
      $sql = "SELECT * FROM contacts WHERE id2=$id2";
      $result = mysql_query($sql);        
      $myrow = mysql_fetch_array($result);
      ?>
	  
      <form action="<?php $v=explode('?',$_SERVER['PHP_SELF']); echo $v[0]; ?>" method="post">
      <input type=hidden name="id2" value="<?php echo $myrow["id2"]; ?>">
   
      Name:<INPUT TYPE="text" NAME="name" VALUE="<?php echo $myrow["name"]; ?>" SIZE=30><br>
      Email:<INPUT TYPE="text" NAME="email" VALUE="<?php echo $myrow["email"]; ?>" SIZE=30><br>
      Who:<INPUT TYPE="text" NAME="age" VALUE="<?php echo $myrow["age"]; ?>" SIZE=30><br>
      Birthday:<INPUT TYPE="text" NAME="birthday" VALUE="<?php echo $myrow["birthday"]; ?>" SIZE=30><br>
      Address:<TEXTAREA NAME="address" ROWS=10 COLS=30><?php echo $myrow["address"]; ?></TEXTAREA><br>
      Number:<INPUT TYPE="text" NAME="number" VALUE="<?php echo $myrow["number"]; ?>" SIZE=30><br>
   
      <input type="hidden" name="cmd" value="edit">
   
      <input type="submit" name="submit" value="submit">
   
      </form>
      
      
   }
}
   if (isset($_POST['submit'])) {
   	  $id2 = mysql_real_escape_string(stripslashes($_POST["id2"]));
      $name = mysql_real_escape_string(stripslashes($_POST["name"]));
	  $email = mysql_real_escape_string(stripslashes($_POST["email"]));
	  $age = mysql_real_escape_string(stripslashes($_POST["age"]));
	  $birthday = mysql_real_escape_string(stripslashes($_POST["birthday"]));
	  $address = mysql_real_escape_string(stripslashes($_POST["address"]));
	  $number = mysql_real_escape_string(stripslashes($_POST["number"]));
 
	  $sql = "UPDATE contacts SET name='$name', email='$email', age='$age', birthday='$birthday', address='$address', number='$number' WHERE id2=$id2";
 
      $result = mysql_query($sql) or die(mysql_error());
      echo "Thank you! Information updated.";
	}
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Does column id2 equal the html form field named id2? That could be a problem if name=id2 doesn't exist in your html form and same with name=submit.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try replacing lines 33 to 50 with the following

<?php
   if (isset($_POST["$submit"]))
   {
   	  $id2 = mysql_real_escape_string(stripslashes($_POST["id2"]));
      $name = mysql_real_escape_string(stripslashes($_POST["name"]));
	  $email = mysql_real_escape_string(stripslashes($_POST["email"]));
	  $age = mysql_real_escape_string(stripslashes($_POST["age"]));
	  $birthday = mysql_real_escape_string(stripslashes($_POST["birthday"]));
	  $address = mysql_real_escape_string(stripslashes($_POST["address"]));
	  $number = mysql_real_escape_string(stripslashes($_POST["number"]));
 
	  $sql = "UPDATE contacts SET name='$name', email='$email', age='$age', birthday='$birthday', address='$address', number='$number' WHERE id2=$id2";
 
      $result = mysql_query($sql) or die(mysql_error());
      echo "Thank you! Information updated.";
	}
}
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well $output is an array and if you intend to only ever have 1 match then use the following.

<?php
$html_input='<img class="a" title="htc-pure-1" src="http://www.site.com/wp-content/uploads/2010/03/htc-pure-1.jpg" alt="">';

preg_match_all('@\<img[^\>]+src\="([^"]+)"[^\>]+\>@Uis',$html_input,$output);

$output=$output[1];
echo $output[0];
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

May I suggest following my pagination tutorial because your code looks like a mess and needs a rewrite.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Could you give us an example of your problem. A demonstration of how to use new lines in php is as follows.

$text='This is the first line\n';
$text.="This is appended to the first line\n";
$text.='This is the second line separated by a \n';
$text.="\nThis is the last line.";

As you can see new lines are separated by \n but are only separated by \n when in double quotes. So in the above example, 2 of those lines showed a literal \n instead of a \n because they were in single quotes. So if you place a \n in double quotes then that will give you a new line and you can use file_put_contents to place the data into a text file.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

As well explained your post was I didn't exactly get the problem. From my understanding you want to use regex to extract links from html input. If that is correct then the following would be your solution.

<?php
$html_input='<img class="a" title="htc-pure-1" src="http://www.site.com/wp-content/uploads/2010/03/htc-pure-1.jpg" alt="">';

preg_match_all('@\<img[^\>]+src\="([^"]+)"[^\>]+\>@Uis',$html_input,$output);

$output=$output[1];
print_r($output);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Your regex should be as follows:

$replace = "#\[vimeo[^\]]+([0-9]+)\]#is";
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Thanks for all your opinions then. I'll get Netbean then :)

@cwarn23: I've done it before myself but thanks for the offer. Can I not use it with IIS though?

If you mean use Netbeans without IIS then although I have no idea what IIS is chances are that Netbeans wouldn't require such an api but I could be wrong. So perhaps try it and see if it works without IIS and if that doesn't work then do a few google searches.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

With 30 to 40 TB of traffic you would probably be best to A - host with your own server at home with an isp that accepts unlimited traffic or B - you can risk yourself in one of those online scams with unlimited traffic. Personally I would go for option A.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Yea, Netbeans will have you covered there but you will also need xampp or wamp installed to work with Netbeans. I can help you with setting it up if needed.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

IMO if you are going to program then it is best to do it right. That means not using gui software to program for you. Usually it is best to just have a syntax highlighter like notepad++ or if your really inexperienced then a debugger like Netbeans but never drag and drop commands. That's my opinion anyways. Other than notepad++ and Netbeans I haven't heard of many other popular programs or none that I can think of. Enjoy.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I'm not saying it can't be broken, but it's pretty good - sufficient for me anyway. SHA variants are also worth looking at. Note - this is hashing, not encrypting. Encryption involves an algorithm creating some ciphertext which can be decrypted with an appropriate key. md5 cannot be decrypted or 'dehashed'.

That is until I complete my dehasher for the sha series than I will continue on the md series. A hard thing to do but fun.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Is there anyway to delete your own post?

The answer to this is no for a good reason. I'm sure that people like Dani don't want the whole of daniweb being deleted because of deleted posts so IMO it is best to not be able to delete posts. Also why would you want your post count to go down instead of up?

I could edit the post but would removing all the text remove my post?

As far as I'm aware removing all the text from a post by editing it does not delete the post but make you look like a fool replying with no information. No offense but could you imagine a person who's posts are usually empty. That would look ridiculous. So always say something smart instead of nothing.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Then could you please post your .htaccess file for one of the sites that do not work.

Hello guys,

I unistalled XAMPP and had installed easyphp and it was running fine. But I don't know if I didn't noticed before but somehow the 403 error doesn't come in Firefox but all other browsers even with easyphp. Does anyone have any idea about it? I think it has to do with folders but I am putting everything in www folder of easy php; so I don't know why this is happening again and again. Thank you.

6pandn21

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Below is a corrected version comparing case insensitive. So it will also work for MaDRiD

if(isset($_POST['City'])) {
 
   echo "<strong>Answer nr1:<BR></strong>";
 
$cities= $_REQUEST["City"];
 
$odp1 = "madrid";
//$odp = "Madrid" && "madrid";
//neither of OR/AND works here 
 
if(strtolower($cities)== $odp1){
	echo "Your answer is <Font Color=#009900>correct</font> <P>";
    } elseif($cities== ""){
	echo "Please fill in this form<P>";
    } else{
	echo "Your answer is <Font Color=#FF0000>false</font> <P> ";
    }
 
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Internet Explorer isn't really designed for plugins although very few are available. I would suggest using a browser like Firefox, Opera or Crome as they all have that feature.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try making line 228 as follows

Options -Indexes FollowSymLinks Includes ExecCGI
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

There are two possibilities and are as follows

<?php
//method 1
explode(',',$input);

//method 2
str_split ($input,6);
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try commenting line 484 with a #

cwarn23 387 Occupation: Genius Team Colleague Featured Poster
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try making the second .htaccess file as follows:

Order allow,deny
Allow from all
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

it's probably just me cant find the error.
it gives me
Parse error: syntax error, unexpected T_ECHO on line 3

but the parse error isn't " instead of '
what is it?

Yes there is a bug and is fixed in the following:

<?php if (($handle = fopen("test.csv", "r")) !== FALSE)  {
 $data = fgetcsv($handle, 1000, ",");
 echo "$data[3] ,  $data[10]"; /* bla bla bla bla */
 fclose($handle);
} 
else echo 'failure opening data file'; ?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Do you mean like the following?

$data=explode(',',file_get_contents('path/to/file.txt'));
for ($i=0;$i<count($data);$i++) {
echo $data[$i];
echo '<br>';
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

This is a file forbidden error. So post your .htaccess file or if you don't have a .htaccess file then post your apache httpd.conf file. It is usually a configuration with the virtual hosts that causes this error.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try each of the following

$results = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 0,1");
$row_table = mysql_fetch_row($results);
$results = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 2");
$row_table = mysql_fetch_row($results);
$results = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 1,1");
$row_table = mysql_fetch_row($results);

My theory is that the limit 1 statment wasn't designed to be ordered by random. But maybe we can make a work around this bug.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

To make things easier the following.

$results = mysql_query("SELECT column1, column2, date, time FROM table LIMIT ROUND(RAND(COUNT(*))),1");
$row_table = mysql_fetch_assoc($results);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I would suggest looking at the gd library. Then later on you might want to switch to the imagick library.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Maybe the following.

$results = mysql_query("SELECT column1, column2, date, time FROM table LIMIT RAND(),1");
$row_table = mysql_fetch_assoc($results);

If that fails to return a row then rand() is returning a number higher than the number of rows present.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Why not use the following?

$number='10000000000';
echo $number.'<br>';
//now some math
echo bcadd($number,'500');
echo '<br>';
echo bcpow('2','2048');

As you can see all numbers can be dealt with as strings using the bcmath library. So this means the size of the number is only limited to the computers ram and cpu instead of 2^63 or 2^31.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you want to insert into different columns different values then try the following.

$array=array('column1'=>'value1', 'column2'='value2', 'column'='another');
$sql='INSERT INTO `table` SET';
foreach ($array AS $key => $val) {
$sql.=' `'.mysql_real_escape_string($key).'` = "'.mysql_real_escape_string($val).'",';
}
$sql=substr($sql,0,-1);

echo $sql;
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have adjusted your code but it is mainly invalid variables. Below is a patched up version of your code but still needs a little improvement as some variables don't exist.

<?php 
include_once "scripts/connect_to_mysql.php";
include("db.php");//Connect to Database
include("tolink.php");

//Insert mysql connections here

$r=mysql_query('SELECT * FROM comments, messages WHERE comments.msg_id_fk = messages.msg_id ORDER BY comments.com_id, messages.msg_id') or die(mysql_error());
$messagedump='';
while ($row = mysql_fetch_assoc($r)) {


$idt=$row['msg_id'];//Message id
$msg=$row['message'];//The Message
$useron=$row['username'];//This is the user where the message is posted on
$date=$row['date'];//Message date
//$msg=toLink($msg);
$id2=$row['com_id'];//Comment id
$comment=$row['comment'];//The Comment 
$date2=$row['_date'];//Comment date
$usernameqw=$row['_username'];//User who posted the comment


if ($messagedump!=$msg) {
	$messagedump=$msg;

$display .='
<li class="bar'.$idt.'"  onmouseover=\'document.getElementById("'.$idt.'").style.display="";\' onMouseout=\'document.getElementById("'.$idt.'").style.display="none";\'>
<div>
<div align="left" class="post_box">

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" width="60px">'.$user_picpost.'</td>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top"><a href="#" class="comment"><font style=" font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#333333;"><b>'.$useron.'</b></font></a>&nbsp;<font style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#333333;">'.$msg.'</font></td>
  </tr>
</table>
</td>
    <td valign="top" width="19px" align="right">
<div id="hide_edit_btn" ><span style="display:none;" class="'.$idt.'"  id="'.$idt.'"><a href="javascript<b></b>: void(0)" id="'.$idt.'" >';

$display.= ($useron == $username || $usernameqw == $username) ? "<div class=\"hover_delete\">&nbsp;</div>" : "";
$display.= '</a></span></div>
	</td>
  </tr>
</table>
</div>

<div id="expand_box">
<div id="expand_url"></div>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="65px">&nbsp;</td>
    <td align="left"><span class="feed_link"><font style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#606060;">'.$date.'  
	</font>
	';
$display.= ($username !=="") ? "&nbsp;-&nbsp;" : "";
$display.= '<a href="#" class="comment" id="'.$idt.'" title="Click here to comment"><font style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#333333;">';
$display.= ($username !=="") ? "comment" : "";
$display.= '</font></a></span></td>
  </tr>
</table>
';
}

$display .='
<div class="comment_load" id="comment'.$id2.'" >
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" align="left" width="32px">'.$user_pic2post3.'</td>
<td valign="top"> …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you want could you incorarate yor code into mine without heredoc.
I tried but it do's not display right.

I could but I would require a html template for the place the php code into. As for how my code works, in the if statement is the message then outside the if statement is the comments.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Perhaps try the following as simular as it might look.

<?php
//Insert mysql connections here

$r=mysql_query('SELECT * FROM `comments`, `messages` WHERE `comments`.`msg_id_fk` = `messages`.`msg_id` ORDER BY `comments`.`com_id`, `messages`.`msg_id`') or die(mysql_error());
$messagedump='';
while ($row = mysql_fetch_assoc($r)) {
if ($messagedump!=$row['message']) {
$messagedump=$row['message'];
echo <<< HTML
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>{$row['username']}</td>
    <td>{$row['message']}</td>
  </tr>
  <tr>
    <td>{$row['date']}</td>
    <td>nbsp;</td>
  </tr>
</table></td>
  </tr>
HTML;
}

echo <<< HTML
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>{$row['_username']}</td>
    <td>{$row['comment']}</td>
  </tr>
  <tr>
    <td>{$row['_date']}</td>
    <td>&nbsp;</td>
  </tr>
</table></td>
  </tr>
</table>
HTML;

}
?>

The bug was $messagedump wasn't being assigned a value.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I need it to display all the messages for that user and inside ever message display every comment for that message
I'm gonna post my code so you can see what i'm talking about

That's what my previous code does. It displays a message then below that all of the comments for that message then goes to the next message. So could you expand on why it doesn't work as the code I posted should do everything you asked in the above quote.