Suchy Posted April 21, 2007 Share Posted April 21, 2007 I have a dynamic dropdown menu filled with names of people that posted to the guestbook. When I select a user I want info about that user to show up (ip, when posted...) if(in("show")) { $id = $_POST['info']; $action = "SELECT * FROM entried WHERE id = '$id'"; $result = mysql_query($action); $name_info = ??? $ip_info = ?? } How can I fill in those variables (name_info , ip_info ) with information from SQL (fields are name , ip ...) Quote Link to comment Share on other sites More sharing options...
ataria Posted April 21, 2007 Share Posted April 21, 2007 if(in("show")) { $id = $_POST['info']; $action = "SELECT * FROM entried WHERE id = '$id'"; $result = mysql_query($action); $row = mysql_fetch_array($result); $name_info = $row['name']; $ip_info = $row['ip']; } I am not sure what the exact field name is, so I just put in 'name' and 'ip'. change if needed. 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.