BigDaddy13 Posted June 18, 2009 Share Posted June 18, 2009 ok, so I have my insert form set up and its working properly. Now, I would like to be able to output an sql query to html. I want to be able to choose say a date range or by a name. For example, I want to run an sql to see how many people are signed up to play a ball game on a certain date. I want to be able to click a button for a this particular query and have a box pop up or a box available for a date range. Then according to the range it will output the results to an html. Hope this makes sense! Thanks in advance! BD Quote Link to comment https://forums.phpfreaks.com/topic/162754-sql-query-output/ Share on other sites More sharing options...
Maq Posted June 18, 2009 Share Posted June 18, 2009 What's your question? Quote Link to comment https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858880 Share on other sites More sharing options...
BigDaddy13 Posted June 18, 2009 Author Share Posted June 18, 2009 I guess a basic how to or a place that I can read on how to. Sorry I wasn't specific! BD Quote Link to comment https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858883 Share on other sites More sharing options...
cs.punk Posted June 18, 2009 Share Posted June 18, 2009 Are you trying to 'retrieve' data from the database? Example: $mysqli_con = mysqli_connect('hostname', 'username', 'password', 'databasename'); $sql = "SELECT * FROM 'tablename'"; $query = mysqli_query($mysqli_con, $sql); while ($result = mysqli_fetch_assoc($query)) {echo "$result[user] is signed up on $result[game_ids] games"; } Quote Link to comment https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858894 Share on other sites More sharing options...
BigDaddy13 Posted June 18, 2009 Author Share Posted June 18, 2009 Yes, I want to pull the info from a db and display the output to an html page. I want to be able to put in a date or name for the results. Quote Link to comment https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858900 Share on other sites More sharing options...
Maq Posted June 18, 2009 Share Posted June 18, 2009 Yes, I want to pull the info from a db and display the output to an html page. I want to be able to put in a date or name for the results. The best way to approach this is to have 3 drop down menus for each date. This approach allows you can control the range, input, and almost eliminate mistakes. You would submit the values either to the same page or a processing page, and use the POST values in the query. You mentioned earlier that you already had a working form, so you should be familiar with this. There are also plenty of examples and tutorials from Google. Quote Link to comment https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858907 Share on other sites More sharing options...
BigDaddy13 Posted June 18, 2009 Author Share Posted June 18, 2009 If you run across a good tut for this..please point me in the right direction. I have searched and searched. Thanks for your help! BD Quote Link to comment https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858935 Share on other sites More sharing options...
Maq Posted June 18, 2009 Share Posted June 18, 2009 If you run across a good tut for this..please point me in the right direction. I have searched and searched. Thanks for your help! BD I'm sure there are a few examples out there that do exactly what you want, but I don't feel like searching, that's your job. What you can do is search for each component, like forms, drop downs, submitting your page to itself, the POST method, MySQL & PHP, etc... Good luck, come back if you have a specific question. Quote Link to comment https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858943 Share on other sites More sharing options...
BigDaddy13 Posted June 18, 2009 Author Share Posted June 18, 2009 Thanks for your response. Please note that I was not asking for you to search for this tutorial. I was asking that if you came across one that you would please point me to it. BD Quote Link to comment https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858946 Share on other sites More sharing options...
Maq Posted June 18, 2009 Share Posted June 18, 2009 Thanks for your response. Please note that I was not asking for you to search for this tutorial. I was asking that if you came across one that you would please point me to it. BD I understand that. But I have faith in you, and I'm sure you'll be able to find something Quote Link to comment https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858950 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.