nodirtyrockstar Posted January 8, 2013 Share Posted January 8, 2013 I would like to run a simple query one time without user input. Can I just use a query? Or is there benefit to doing it another way? Quote Link to comment Share on other sites More sharing options...
Barand Posted January 8, 2013 Share Posted January 8, 2013 Use something like MYSQL Workbench or PHPMyAdmin. Then you run a query or browse the contents of the tables. Quote Link to comment Share on other sites More sharing options...
nodirtyrockstar Posted January 8, 2013 Author Share Posted January 8, 2013 I guess my question was too vague! Sorry. I am using PHP and mysqli. I am used to writing prepared statements to deal with user input/repetition. Since I just need to auto-pop a drop down menu with a list of items found in one column of my table, I was hoping to use the simpler $mysqli->query() method, and just wanted to check in with the experts first. Quote Link to comment Share on other sites More sharing options...
Barand Posted January 8, 2013 Share Posted January 8, 2013 I guess my question was too vague! You could say that The answer is yes. eg $result = $mysqli->query("SELECT id, name FROM mytable ORDER BY name") Quote Link to comment Share on other sites More sharing options...
nodirtyrockstar Posted January 8, 2013 Author Share Posted January 8, 2013 Thanks! 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.