Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 53
Name: Keith
Trades: 0
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
 
 
Register now for full access!
Old 11-14-2007, 05:29 PM Re: Problem with MySQL Page Refresh
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Maybe try a javascript refresh
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 11-14-2007, 09:35 PM Re: Problem with MySQL Page Refresh
Extreme Talker

Posts: 238
Location: United States
Trades: 0
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: 340
Name: Jon
Location: New York
Trades: 0
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
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
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: 481
Location: Gold Coast - Brisbane QLD, Australia
Trades: 0
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 ...>
__________________
I do
Please login or register to view this content. Registration is FREE
based.
Spend a lot of time in
Please login or register to view this content. Registration is FREE
.
And
Please login or register to view this content. Registration is FREE
chews up the rest.

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.55555 seconds with 12 queries