AshleyByrom Posted July 29, 2009 Share Posted July 29, 2009 Right well here is what I need help with. I have set up a messaging system but it is very basic. It used a MySQL database which stores all the messages I can send and retrieve them etc. The database has a 'touser' column which is filled with the username of the user who should receive the message. My problem is I would like to use some sort of textbox suggesting (like facebook does) so that when you start typing a username a whole list of matching usernames comes up in a little box (preferably showing a 30x30 image of their dp too). The sender can then click the correct user and they are inserted into the To: field. My second problem is i would like a way to send messages to multiple users... I am guessing I would have to do some modifications to my table and the script I use for the To: field would have to support multiple entries too. I would like, if possible, mainly PHP tutorials so I don't have to dive into the unknown javascript, ajax etc. (I'm just about learning PHP) Any help is appreicated! Thanks! Link to comment https://forums.phpfreaks.com/topic/167998-messaging-system-multiple-users-textbox-suggesting-facebook-ish/ Share on other sites More sharing options...
cleibesouza Posted July 29, 2009 Share Posted July 29, 2009 For your first challenge (don't like the word problem) the only solution I see is Ajax. Auto suggest isn't that hard to set up, but you will have to do some reading on that. In a nutshell the script would be calling a php page that would query a table with possible matches every time a letter is entered. This is a good place to start: http://www.w3schools.com/php/php_ajax_suggest.asp Link to comment https://forums.phpfreaks.com/topic/167998-messaging-system-multiple-users-textbox-suggesting-facebook-ish/#findComment-886156 Share on other sites More sharing options...
abazoskib Posted July 29, 2009 Share Posted July 29, 2009 i wouldnt query each time a user types a letter, i would pull all the friends once. then sort alphabetically and show the matches as the user types. some would say that querying all the friends is unnecessary, however running one query lasting 4 seconds(for arguments sake) is better than running 20 queries at a second each. Link to comment https://forums.phpfreaks.com/topic/167998-messaging-system-multiple-users-textbox-suggesting-facebook-ish/#findComment-886200 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.