Reply
Problem with MySQL Page Refresh
Old 11-14-2007, 04:55 PM Problem with MySQL Page Refresh
Y-aji's Avatar
Experienced Talker

Posts: 46
Name: Keith
Hello all:

I have not been online for some time, I know, however, all the help i have received has not been for nothing. I am still working restlessly with web and have maticulously worked my way from plain html (2yrs ago), to css driven html(1yr ago), to php(6m ago), and now php w/ mysql functionality (i feel like I'm playing WoW and leveling up or something.)

Anyway, to the question:

I have been designing database driven websites for a few months, now and continuously run into the same problem. When I delete something, or change something, or add something, I have to manually refresh the page to get the updated information. I have tried header and my server gets really p****d off about it.
Any suggestions on updating a page without the use of header, or a solution for my code that will evade the need to refresh all-together?

Much thanks,



Keith

Last edited by mgraphic : 11-14-2007 at 11:38 PM. Reason: language filter
Y-aji is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 11-14-2007, 05:29 PM Re: Problem with MySQL Page Refresh
NullPointer's Avatar
Will Code for Food

Posts: 471
Name: Matt
Location: Irvine, CA
Maybe try a javascript refresh
__________________
http://tinsology.com/ - Under construction
NullPointer is offline
Reply With Quote
View Public Profile
 
Old 11-14-2007, 09:35 PM Re: Problem with MySQL Page Refresh
Extreme Talker

Posts: 232
Location: United States
Are you deleting/changing/adding your database through AJAX or iframes?

If so, I can see how you would run across this issue. You could fix that with a refresh using a JavaScript refresh as NullPointer mentioned or an AJAX request.

If not, how are you getting this problem? Generally your PHP script will run the MySQL queries and do all of its processing at the beginning of the script, and all of the display/output stuff is done near the end of the script.
__________________
The interlocking pieces of web development: usability, performance, accessibility, and standards.
frost is offline
Reply With Quote
View Public Profile
 
Old 11-17-2007, 11:29 AM Re: Problem with MySQL Page Refresh
amw_drizz's Avatar
Ultra Talker

Posts: 301
Name: Jon
Location: New York
i use javascript refresh for my sites when users modify their info, that parses through the same page, just refresh at the end with a passed var that skips the code of going to the mysql to insert or edit data
__________________
AMW_Drizz
Php 5.2 Mysql 4.1 IIS 6 Win2k3 Server && PHP 5.2 MySQL 4.1 Apache 2.2 (separate machine of course)
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 11-17-2007, 05:52 PM Re: Problem with MySQL Page Refresh
metho's Avatar
Ultra Talker

Posts: 345
This is a problem with your logic. When writing a script for a page that includes a form, which changes db records AND that page is displaying those records, you have to accommodate potential changes to the records in your logic.

For E.G

PHP Code:
<?php
//includes here


//PAGE VARS (GET & declare vars used out of form processing)
//include page var validation here as well

//FORM PROCESSING
//process your forms before pulling records for output to the webpage
//update/overwrite any session vars before proceeding to page processing


//PAGE PROCESSING
//pull your records from the db AFTER form processing

//HTML Output

?>
<html ...>

Last edited by metho : 11-17-2007 at 05:53 PM.
metho is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Problem with MySQL Page Refresh
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13306 seconds with 13 queries