Jump to content
Sign in to follow this  
shinnosuke

Auto Update Database

Recommended Posts

katakan aku nak buat satu system guna mysql + php or jsp or servlet .. it will check and auto update most probably every second .. for example inventory barang2 .. it will compare expire date with current date and if the dbms found the expired stuff it will mark it expired. Benda ni kena check in second percission not every hours or daily..

so soalannya .. apakah cara yang efective untuk implement benda tersebut? .. kena wat pakai server scripting (php,jsp) or dekat dbms or mysql tu boleh buat sendiri ..

sila beri gambaran.. TQ

Share this post


Link to post
Share on other sites

Depends camner ngko ndak buat auto update tuh. Kalau ngko guna PHP kat Linux, ngko boleh runkan misalnya guna command gini php autoupdate.php dimana autoupdate.php tuh akan check database every second. Cara lain ndak implement adalah guna jerk any programming language yang boleh connect ke MySQL.. dan check database every second. Misalnya ngko develop VB.NET application dimana dia check database every second (i would rather do 2 or 3 seconds intervals. Every second tuh berat jugak tuh ndak run especially kalau table yang ngko check tuh besar).... pun boleh jugak... bergantung kepada kemahiran ngko lebih cenderung kepada which language. So server scripting samaada PHP, JSP boleh digunakan ataupun any stand alone programming language.

Good luck

Edit:

guna header nih untuk auto update


	<meta http-equiv="Refresh" content="5">
	<meta http-equiv="Pragma" content="No-Cache">
	<meta http-equiv="cache-control" content="no-store, no-cache, must-revalidate, private">

Edited by Rads78

Share this post


Link to post
Share on other sites

alamak.. yang auto update tu takleh pakai la pasal bila run je,dah abis sript tu dia terus keluar .. nak wat loop takleh lak..ada timeout pastu makan resource banyak.. nak pakai cron, dalam windows lak.. nak pakai schedular ikut jam pulak .. bagai mana ye?

Share this post


Link to post
Share on other sites

So nampak gaya.. last solution. Ndak kena buat program sendiri lar. Setakat benda kekecik nih jerk... kalau ngko ada VB6 pun dah cukup.... buat program dan set timer dia suruh loop check kat database.

Share this post


Link to post
Share on other sites

Mmm.. complicated gak cara korang tu. Aku cadangan ko guna teknik store procedure dalam database. Gabungkan dengan fungsi trigger. Aku tak sure kalau guna mySQL tapi kalau guna MS SQL Firebird, Oracle, Interbase atau Firebird mmg senang nak set.

Cuba hang cari topik stored procedure and trigger dalam help file mySQL. Sure jumpa. Adios

Edited by sylbilassys

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...