php - Not displaying "sent" message -


i working on simple inbox/pm system, , can't figure out why can display working sent messages, can display list of sent items, view pms inbox, not sure doing wrong, tips appreciated..

here code:

<table> <?php $id = $_get['id']; $from_user = $_session['user_id']; $sql = "select users.user_id, users.username, users.profile, messages.id, messages.to_user, messages.from_user,          messages.subject, messages.message, messages.has_read, messages.deleted, messages.date_sent         `messages`         join `users` on messages.to_user = users.user_id          messages.from_user = '$from_user' , messages.id = '$id' order messages.date_sent desc"; $result = mysql_query($sql); $rows = mysql_fetch_array($result); $from_user = $rows['from_user']; $subject = $rows['subject']; ?><tr> <td width="50px" align="center"> <img src="<?php echo $rows['profile']; ?>" width="40px"><br><?php echo $rows['username']; ?> </td> <td valign="top" width="350px"> <b><?php echo $rows['subject']; ?></b><br> <?php echo $rows['message']; ?> </td><td><?php echo $rows['date_sent']; ?></td> </tr> <tr> <td colspan="3"><hr></td> </tr> </table> 

your have $from_user specified twice, try removing second , see how go.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -