problem about function concat

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
powerights
Forum Newbie
Posts: 2
Joined: Mon Sep 21, 2009 6:00 am

problem about function concat

Post 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!
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: problem about function concat

Post by Mark Baker »

$_POST['reply'] not $_POST[reply]
Where is $num coming from?
powerights
Forum Newbie
Posts: 2
Joined: Mon Sep 21, 2009 6:00 am

Re: problem about function concat

Post 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 ..
Post Reply