zenix Posted October 1, 2009 Share Posted October 1, 2009 Hello, I have been working hard this past year trying to learn php and mysql. I've even developed my own little database of contacts. Anyway, I thought it'd be neat (if possible) to have a textarea on the page my data form is on to display the first, last names and phone numbers of the contacts in the db, then have it so all I have to do is scroll through the list and click the one I'd like to have displayed in my form.. I don't know how to do this. My database works great, I just thought this could facilitate a little more learning...and it would be a nice addition. If anyone has any idea on how I might achieve this I'd really appreciate it if you'd let me know. Thanks!! Quote Link to comment Share on other sites More sharing options...
lemmin Posted October 1, 2009 Share Posted October 1, 2009 Here is a tutorial on how to use PHP with MySQL: http://www.freewebmasterhelp.com/tutorials/phpmysql/ Quote Link to comment Share on other sites More sharing options...
zenix Posted October 1, 2009 Author Share Posted October 1, 2009 I appreciate your input, thank you. My problem isn't the database...I have THAT working quite well. I would just like to see if I can have the names and maybe phone number of the contacts displayed in a text box so I can click on one and have all the information (address, phone, email etc...) appear in the form. Quote Link to comment Share on other sites More sharing options...
lemmin Posted October 1, 2009 Share Posted October 1, 2009 Page four of that tutorial should explain how to output the data: http://www.freewebmasterhelp.com/tutorials/phpmysql/4 Quote Link to comment Share on other sites More sharing options...
zenix Posted October 1, 2009 Author Share Posted October 1, 2009 Thank you again, I'd actually like to know how to make it so I can click on an entry in the text box and have the fields populate with the associated data. I'd probably more of an AJAX or Javascript issue I guess. I was just hoping to be able to do it with php. Quote Link to comment Share on other sites More sharing options...
cags Posted October 1, 2009 Share Posted October 1, 2009 PHP is a server side scripting language and cannot effect anything client side. Ajax is basically a technique that allows JavaScript to communicate with PHP to sort of fake a true synchronous communication. You will not be able to do it without using Ajax unless your ok with submitting a form everytime you wish to change the page. You wouldn't really want to design it in a way that would have you clicking in a textbox, you'd really want either a search box you type in or a dropdown box. Quote Link to comment Share on other sites More sharing options...
zenix Posted October 1, 2009 Author Share Posted October 1, 2009 Just curious, why wouldn't I want it in a text box rather than a drop down box? Just curious, very new to programming. Thanks! Quote Link to comment Share on other sites More sharing options...
cags Posted October 1, 2009 Share Posted October 1, 2009 A textbox should really be used for inputing or editing text. If you wanna display text, just use plain text. If you wanted a list of items to select from and a dropdown box isn't the look your after you could have a list of anchor links (<a hrefs) or whatever. Either way, symanically or asthetically a textbox really isn't a good way to have a menu per-se. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.