Thread: regarding mysql

  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    90

    regarding mysql

    iam inserting the values into mysql by include "mysql.h".
    now when anyone updated mysql table i need to execute some function.
    is there anyway to handle this
    thank u
    sree

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    You have to be more specific than that.

  3. #3
    Registered User
    Join Date
    Aug 2006
    Posts
    90
    suppose iam having a table students;
    iam having a recored
    student name :sree
    number:1241
    marks:345

    if anyone change the record suppose marks:345 to 400
    once the updation of the table occur then i have to handle this in our c program and i have to update it to 400.

  4. #4
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Quote Originally Posted by MacGyver View Post
    You have to be more specific than that.
    And again.

  5. #5
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    Almost sounds like you're talking about a trigger but that's on the database side of things, not your application.

    [edit]Sounds like you want your application to detect outside changes to the database table? Continually polling/reading the table every so often doesn't sound like a good idea if the table has a large amount of data in it. Maybe a trigger in the database that detects inserts/updates on the table in question and then updates a second table setting a "Changed" flag to true or something. Your app could read this small table single-field every second and if it becomes true you do a reread of the original table and set the "Changed" flag back to false.[/edit]
    Last edited by hk_mp5kpdw; 12-20-2007 at 06:53 AM.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Change detection in MySQL.
    By amitbora27 in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 05-13-2009, 10:34 AM
  2. MySQL libraries
    By csonx_p in forum C++ Programming
    Replies: 6
    Last Post: 10-02-2008, 02:23 AM
  3. About C++ and MySQL or oether free database
    By xxxrugby in forum C++ Programming
    Replies: 18
    Last Post: 12-30-2005, 06:28 AM
  4. Get data from mysql and use in a system.
    By smaakage in forum Tech Board
    Replies: 3
    Last Post: 10-04-2005, 12:03 PM
  5. Get data from mysql and use in a system.
    By smaakage in forum C++ Programming
    Replies: 5
    Last Post: 10-02-2005, 01:25 PM