brokenmech Posted January 28, 2010 Share Posted January 28, 2010 I want to basically use the code from this tutorial http://www.tutorialized.com/view/tutorial/Simple-Chatbox-in-PHP-MySQL/23971 but instead of users entering their names I want to run the checklogin and pull the name of the user from the database. I am having two problems with the basic tutorial code though. I am getting a notice that I have an undefined variable here... $message=Smiley($message); //Smiley faces print "<font color='red'><b>$getmsg3[name]:</b></font> $getmsg3[message]<br>"; } function Smiley($texttoreplace) { $smilies=array( '' => "<img src='images/smile.gif'>", ':blush' =>"<img src='images/blush.gif'>", ':angry' =>"<img src='images/angry.gif'>", ''=> "<img src='images/shocked.gif'>", '[s]fuck[/s]'=>"$#$%", '[s]Fuck[/s]'=>"&$#@" ); $texttoreplace=str_replace(array_keys($smilies), array_values($smilies), $texttoreplace); return $texttoreplace; } and I am getting a syntax error here... $startrow=$getmessages3-20; Any help or suggestions would be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/190076-im-trying-to-make-a-simple-chat-window-for-a-phpmotion-site/ Share on other sites More sharing options...
trq Posted January 28, 2010 Share Posted January 28, 2010 What exactly is the error message? Link to comment https://forums.phpfreaks.com/topic/190076-im-trying-to-make-a-simple-chat-window-for-a-phpmotion-site/#findComment-1002847 Share on other sites More sharing options...
brokenmech Posted January 28, 2010 Author Share Posted January 28, 2010 Notice: Undefined variable: getmessages3 in C:\wamp\www\chat\chatlog.php on line 15 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20,36' at line 1 Link to comment https://forums.phpfreaks.com/topic/190076-im-trying-to-make-a-simple-chat-window-for-a-phpmotion-site/#findComment-1002849 Share on other sites More sharing options...
trq Posted January 28, 2010 Share Posted January 28, 2010 So, where are you defining $getmessages3 ? Link to comment https://forums.phpfreaks.com/topic/190076-im-trying-to-make-a-simple-chat-window-for-a-phpmotion-site/#findComment-1002861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.