robert_gsfame Posted December 10, 2010 Share Posted December 10, 2010 will refresh a page every second will cause some crash or error ?? cause when i try this, it sometimes display this error "Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL " this is occur when i run it in my local server. I am so worried if this might also happen when i run it online. thx Quote Link to comment https://forums.phpfreaks.com/topic/221224-refresh-every-second/ Share on other sites More sharing options...
Adam Posted December 10, 2010 Share Posted December 10, 2010 Firstly, why would you want to refresh the page every second? If it's absolutely necessary, and will run for long periods of time, then you may be better opening a persistent connection with mysql_pconnect. Quote Link to comment https://forums.phpfreaks.com/topic/221224-refresh-every-second/#findComment-1145397 Share on other sites More sharing options...
robert_gsfame Posted December 10, 2010 Author Share Posted December 10, 2010 problem still exists even when i have closed the connection using mysql_close() actually i have 2 frames and when i update the second frame, i wish to display the updated one in the first frame either, that's why i update the 1st frame every second don't have any idea on how to refresh the first frame from the second frame.. please give me some guides. thx Quote Link to comment https://forums.phpfreaks.com/topic/221224-refresh-every-second/#findComment-1145409 Share on other sites More sharing options...
MMDE Posted December 10, 2010 Share Posted December 10, 2010 frames why do you use frames? And yes, you can just make it refresh the other frame? =o http://forums.tizag.com/showthread.php?t=2282 Look there. (shouldn't be too hard to google for this, personally never done it though) if you provide the html and php for me, I will fix it for you. But way smarter than refreshing a site every second o.o Quote Link to comment https://forums.phpfreaks.com/topic/221224-refresh-every-second/#findComment-1145419 Share on other sites More sharing options...
OOP Posted December 10, 2010 Share Posted December 10, 2010 Why would someone need to refresh a page every second? Can you please explain your requirements? Quote Link to comment https://forums.phpfreaks.com/topic/221224-refresh-every-second/#findComment-1145446 Share on other sites More sharing options...
QuickOldCar Posted December 11, 2010 Share Posted December 11, 2010 No idea why would want every second. But how about a meta redirect. echo('<meta http-equiv="refresh" content="1">'); or can point it somewhere also echo('<meta http-equiv="page.php" content="1">'); Quote Link to comment https://forums.phpfreaks.com/topic/221224-refresh-every-second/#findComment-1145607 Share on other sites More sharing options...
Adam Posted December 11, 2010 Share Posted December 11, 2010 To be honest, I'll help you soon as I hear a valid reason for an update every *second* - not being a dick, it's just teaching people bad habits. Nothing, requires an update every second, especially frames. You render the frame entirely useless because it updates ever second. Perhaps if you explained what it is you're trying to do ..? Quote Link to comment https://forums.phpfreaks.com/topic/221224-refresh-every-second/#findComment-1145619 Share on other sites More sharing options...
robert_gsfame Posted December 11, 2010 Author Share Posted December 11, 2010 This is actually the problem i have two frames let assume this: 1st frame is for name.php which is consist of name of a person 2nd frame is detail.php which will display the detail of each chosen person so when u click on the name, 2nd frame will display the detail. I have something like favorite tag on the 2nd frame, so when they want to easily tag particular name to be easily memorized, they could just give a tag by clicking on the "favorite tag" button. When they click on it, i use header() and redirect them to another page to UPDATE the record and redirect them back to detail.php What i really want is to give some small flag symbol before each name if being "tagged" on name.php that is why i do refresh every second... . seems to be very easy if not doing it in frames Quote Link to comment https://forums.phpfreaks.com/topic/221224-refresh-every-second/#findComment-1145639 Share on other sites More sharing options...
MMDE Posted December 11, 2010 Share Posted December 11, 2010 but why do you use frames? Quote Link to comment https://forums.phpfreaks.com/topic/221224-refresh-every-second/#findComment-1145640 Share on other sites More sharing options...
OOP Posted December 11, 2010 Share Posted December 11, 2010 You can use ajax to achieve this without using the frames and without refreshing the whole page Quote Link to comment https://forums.phpfreaks.com/topic/221224-refresh-every-second/#findComment-1145713 Share on other sites More sharing options...
BlueSkyIS Posted December 11, 2010 Share Posted December 11, 2010 yeah, a website that fully refreshed 2 frames every second would drive any user insane very quickly. Quote Link to comment https://forums.phpfreaks.com/topic/221224-refresh-every-second/#findComment-1145757 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.