Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/162754-sql-query-output/
Share on other sites

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";
}

Link to comment
https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858894
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858907
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858943
Share on other sites

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  ;)

Link to comment
https://forums.phpfreaks.com/topic/162754-sql-query-output/#findComment-858950
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.