twilitegxa Posted September 12, 2008 Share Posted September 12, 2008 I also have some other files that are generating errors: <?php include "connect.php"; if(isset($_POST['submit'])) { $searchterm=$_POST['searchterm']; $getmsg="Select * from chatmessages where message like '%$searchterm%' order by postime desc"; $getmsg2=mysql_query($getmsg) or die("Could not get messages"); print "<table border='1'><tr><td>Name of poster</td><td>IP</td><td>Message</td><td>Edit</td><td>Delete</td></tr>"; while($getmsg3=mysql_fetch_array($getmsg2)) { print "<tr><td valign='top'>$getmsg3[name]</td><td valign='top'>$getmsg3[iP]</td><td valign='top'>$getmsg3[message]</td><td valign='top'><A href='editm.php?ID=$getmsg3[iD]'>Edit</a></td><td valign='top'><A href='delete.php?ID=$getmsg3[iD]'>Delete</a></td></tr>"; } print "</table>"; } else { print "<form action='editdelete.php' method='post'>"; print "Search for messages (leaving blank will return all messages:<br>"; print "<input type='text' name='searchterm' size='20'><br>"; print "<input type='submit' name='submit' value='submit'></form>"; } ?> This one is not returning the ip addresses for some reason. Can anyone tell me why? Link to comment https://forums.phpfreaks.com/topic/123880-solved-more-chat-help/ Share on other sites More sharing options...
MasterACE14 Posted September 12, 2008 Share Posted September 12, 2008 uhhh, you haven't concocted the array data correctly on this line.... <?php print "<tr><td valign='top'>" . $getmsg3['name'] . "</td> the really long Print.... you need to put " . $getmsg3['name'] . " inside the print like that. And put single quotes around the name. Link to comment https://forums.phpfreaks.com/topic/123880-solved-more-chat-help/#findComment-639578 Share on other sites More sharing options...
twilitegxa Posted September 12, 2008 Author Share Posted September 12, 2008 That didn't work, but I did figure it out. My $getmsg3[ip] said $getmsg3[iP], so I changed it to lowercase and it works now. Thanks for the help anyway though! Link to comment https://forums.phpfreaks.com/topic/123880-solved-more-chat-help/#findComment-639974 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.