Ankit Ankit - 1 year ago 65
MySQL Question

Use data from a database to redirect to a new page

I am using PHP, HTML and a mySQL database.

My requirements:

  1. Query for some data from the database and print it out.

  2. Compare the data with some pre-defined values.

  3. If the value is not in the range, raise a notification alert box.

  4. Once, the user clicks 'OK'--> Open up a new webpage.

For example:

  • The query result '199' is stored in

  • If $result is less than 200 (true in this case) then present an

  • Once the user clicks 'OK' in the
    load a new HTML page.

I am confused how to approach this.

I am able to get
with a php script and display it.

Beyond that I am not able to use
for comparison.

Answer Source
  1. You can send queries to server using ajax calls
  2. Compare the results with predefined values
  3. If a match occurs,insert the code

window.location = '/some/url';

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download