Current location: Hot Scripts Forums » Programming Languages » PHP » Database Change, PHP Auto Update??


Database Change, PHP Auto Update??

Reply
  #1 (permalink)  
Old 02-19-08, 05:19 PM
memphis2k memphis2k is offline
New Member
 
Join Date: Feb 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Database Change, PHP Auto Update??

Hello, I'm a PHP newbie but have used a few languages in the past. Here is my question.

I need help finding a way to automatically update a PHP page after the database has been changed.

Setup:
I'm setting up a system with an admin & client based side with logged in users.
When I make a certain change to the DB, i.e. select a driver that won the race, JeffG. Then would click Apply would save it to the DB.

With a user logged in, it would say JeffG Wins! with a picture below. Then the client would be able to click "OK" button and return to the previous page.

Newest XAMPP running under WinXP SP2 - Admin updater
Clients would be running a small-sized screen Opera browser. I don't think I can use "popups' of any sort or an 2nd window/tab. Idea is VERY similar to a forums PM system!

I have attachted 4 images, they go in the order of what should happen. Quick example only.

Main concept: I want the PHP page to look for a change in the DB, if change exists, Update entire PHP page with it (Overlay) OR a whole new page. Think of it as an "alert" but can't be a dialog box.

Any tutorials would be much appreciated, n00b! Ideas, throw them out there!
Attached Images
File Type: jpg Alerts_1.jpg (9.8 KB, 3423 views)
File Type: jpg Alerts_2.jpg (6.7 KB, 3420 views)
File Type: jpg Alerts_3.jpg (13.6 KB, 3431 views)
File Type: jpg Alerts_4.jpg (6.7 KB, 3412 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 02-19-08, 05:50 PM
Jay6390's Avatar
Jay6390 Jay6390 is offline
Code Master
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,330
Thanks: 0
Thanked 0 Times in 0 Posts
Hi memphis2k. I'm guessing that this is for some sort of mobile/pda. I'm not too sure if its possible to do with them, but if javascript is enabled, this will be possible through AJAX to dynamically check the result at a set interval. You will need to make the scripts to check for a last updated time for the db entries. For tutorials on php in general have a look at my sig. If you are after a more direct approach to getting this however, I would suggest you use the script requests or job advertising forums to find what you need

Jay
__________________
Useful Tutorials
[ PHP Video-1-2-3 ] [ MySQL 1-2-3 ]
For any php function reference type

www.php.net/FunctionName
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 02-21-08, 05:12 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
Usually you don't "update" a php page. What you need is a simple script that grabs the last added entry in your mysql table and show it through php on the page. This is not updating the php page, but simply executing the php page.

What you need are the good old mysql functions (if you're database is a mysql server of course), and some basic php programming
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 02-22-08, 02:44 AM
memphis2k memphis2k is offline
New Member
 
Join Date: Feb 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks guys. I'll start working on these alerts tomorrow. Have a long list of ideas for the Alerts DB... basically functionality. Been learning like crazy and been having fun. Good points, yah I think the php will constantly check for a change in the DB and go from there. Endless loop w/ 10 sec interval? (Yah I'll search tomorrow)

Newbies learn by seeing examples & playing with them. Php seems at the moment harder to find "ideal" scripts but its getting better since there's a heck of a lot out there. Been to unwilling to learn a DB approach as appose to ASP/CSS/HTML until just recently. XAMPP did it for me!

I believe my mobile device can't do javascript, so I am trying my best to do everything server-side, MySQL.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 02-22-08, 05:47 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
Quote:
Originally Posted by memphis2k View Post
Endless loop w/ 10 sec interval?
No: you don't need a loop. PHP is request-based: so when a user visits your page, it will process the php code, and display the outcome to the user. You don't need an endless loop to keep checking if there's any update in the database, you simply need to refresh the page.

If you want the page to refresh automatically, I tink you'll need javascript, but maybe you can do it with the header function
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting multiple records from MYSQL database using PHP sujata_ghosh PHP 5 06-04-09 04:07 AM
PHP does NOT update the mysql when rapidly sent through browser - $20 REWARD PAYPAL billyspcs PHP 2 04-22-06 02:56 PM
Php needed for Education Database to revolutionize learning Mystefier Job Offers & Assistance 2 09-10-05 01:52 PM
Need Help Searching SQL database with PHP jasonweaver PHP 1 07-18-05 07:27 PM
PHP search database korro Script Requests 0 04-17-05 06:17 AM


All times are GMT -5. The time now is 03:41 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.