Page 1 of 1

problem about function concat

Posted: Mon Sep 21, 2009 6:02 am
by powerights
<form action="reply.php" method="post">
<textarea name="reply" rows=7 cols=60></textarea><br>
<input type=submit name="submit" value="ok"/>
</form><p>
<?php
include("conn.php");
$sql="update msg set msgs=concat(msgs,".$_POST[reply].") where id=$num";
$query=mysql_query($sql);
?>


i dont know how to write concat()
something wrong with $_POST[reply]
help me, plz.thank u!

Re: problem about function concat

Posted: Mon Sep 21, 2009 6:19 am
by Mark Baker
$_POST['reply'] not $_POST[reply]
Where is $num coming from?

Re: problem about function concat

Posted: Mon Sep 21, 2009 6:47 am
by powerights
$num from 'admin.php' the code :

Code: Select all

<?php
include "conn.php";
?>
<table width=500 border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?
  $sql="select *from msg order by id desc";
  $query=mysql_query($sql);
  while($row=mysql_fetch_array($query)){
?>
  <tr bgcolor="#eff3ff">
  <td><?=$row[id]?>#  Name:<?=$row[name]?> </td>
  </tr>
  <tr bgcolor="#ffffff">
  <td>Tel.<?=$row[tele]?>  Time:<?=$row[lastdate]?></td> 
  </tr>
  <tr bgColor="#ffffff">
  <td>Message.<?=$row[msgs]?> 
<a href="del.php?num=<?=$row[id]?>">[Del.]</a>
<a href="reply.php?num=<?=$row[id]?>">[Reply]</a> </td>
  </tr>
<?
}
?>
</table>
 
$_POST['reply'] has tried , not work ..