473,387 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

code for Updating a query when the browser is closed

hi all,
i am manoj i have a problem with my project ,i need a code to update a mysql query when the browser is automatically closed (in php).kindly suggest me its important for me
thank u ..manoj
Jun 7 '07 #1
3 2633
ronnil
134 Expert 100+
autmatically closed, as in some function you created forces the window to close?

in that case you would probably want to use AJAX to connect to a php file and execute the query.

bear in mind that PHP is a serverside language, meaning php has no knowledge of what you might do with/in your browser.
Jun 7 '07 #2
autmatically closed, as in some function you created forces the window to close?

in that case you would probably want to use AJAX to connect to a php file and execute the query.

bear in mind that PHP is a serverside language, meaning php has no knowledge of what you might do with/in your browser.


hi ronnil thanks for the reply ,i need to know weather is it possible using java script or not & need a small help from u that i have no knowledge about ajax so if possible can u send me the code to be used in php...
thank u ..
Jun 8 '07 #3
ronnil
134 Expert 100+
the php code would merely be:

<?php
$sql = "UPDATE sometable set somerow=somevalue";
//your sql query
?>

check out the link in the prior post, it gives you enough knowledge to use AJAX, if you're afraid of learning a new language... don't worry, it's just a way to use implemented functions of javascript :)

I don't think you can make up a proper working solution with javascript. You would need to use an event called onclose event, which ain't there as far as i know.

If this window is opened by another window you control, you can in the opener however make a loop checking if the window is open, when it's not no more, perform the query (using AJAX ;))
Jun 8 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jonathan | last post by:
I am trying to upload a new version of a file that already exists on my web site. It asks me to overwrite and I choose yes. But when I go to the web page, even a half hour after the upload, the...
4
by: Spark | last post by:
Hi, Situation: Need a query to return number of ticket records by month of open in a log table where the ticket open record is older than 24 hours then the ticket pending or ticket closed...
4
by: ced | last post by:
Hallo, I have some JS which creates a new 2-frame window. The new window (via onLoad) backfills a variable in the parent window so I'll know when it's safe to load the target frame. The...
4
by: Dave Hitt | last post by:
I'm trying to put a function into a query. I want to check the logical field "closed." If it's true, I want to return a text value of "Closed". If false, I want to return a text value of "Not...
5
by: Haydnw | last post by:
Hi, I have the code below as code-behind for a page which displays two images. My problem is with the second bit of code, commented as " 'Portfolio image section". Basically, the SQL query gets...
3
by: stuart.medlin | last post by:
I have an Access 97 application that has a basic form (Transcript) and subform. The subform has a query as a recordsource that returns records from a table: SELECT DISTINCTROW Transcript.NCID,...
5
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
3
by: Gouri.Mahajan7 | last post by:
Hello, I am new to asp.net. Can anybody please tell me which event is fired when we close the browser. I want to remove some resources when the browser close button is pressed. Thanks in advance....
3
by: webster5u | last post by:
Miss/Mr. Programmer, I have a idea to remove the cookie value from a website after all browser closed. It is like session kept in server and eliminate after all browser closed. My purpose is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.