Re: Help with a query, and return result on the same page.

From: Date: Tue, 31 Jul 2001 15:45:06 +0000
Subject: Re: Help with a query, and return result on the same page.
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-8597@lists.php.net to get a copy of this message
Hi Martin, PHP is only executed when the user requests the page. It is all processed by the server on the server-side (thus it's called a server-side scripting language), before returning any HTML to the user. Thus, you can't "dynamically" pull data once a page has loaded. What you can do is simulate it by either posting the user's selections through a form or passing the user's selections via a query string, back to the same page, and then have the newly generated PHP reflect the change. The one exception is to use JavaScript to simulate dynamic database querying, by pre-loading all data into JavaScript variables (most likely arrays), and then use the client-side JavaScript to pull it up when the user interacts with the page. But this isn't good for large sets of data and relies on the user having JavaScript enabled and a browser that handles it well. So, getting back to the original solution, you could do something where on the initial page the user picks the stuff just like you've said, then submits it, then the same page comes up with the selected info as well as the database results. Do you see what I'm saying? I know I say it kind of complicated, but it's actually a pretty basic thing. You'll get the hang of it. -Mike At 10:48 AM 7/31/2001 -0400, Martin Tengowski wrote:
I am trying to query a database, and return the results on the same page. I have a form to enter the item that I want to query. I would like to have a table below, so that the results would be displayed. right now I'm just using a small database to get the things working. I can query a database and display the data when the page is loading, but not able to do a query and display only the desired data from a form. Most of the database work that I would need to do right now is on this order. Have a page setup where the users would come in and select or enter the query criteria, and the data will then be pulled and displayed from the database. I am connected to MySql, and can connect to ODBC... I have been going through tutorials and also using DreamWeaver UltraDev with PHP extensions...but have not found an example like this... Thanks Martin -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net For additional commands, e-mail: php-windows-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
              -=- Mike Flynn - Burlington, VT -=-
mike@mikeflynn.net http://www.mikeflynn.net/ * Give blood * American schoolchildren today are taking four times as many psychiatric meds as all of the rest of the world combined.

« previous php.windows (#8597) next »