turbobaltss06
New member
- Joined
- Feb 3, 2014
- Messages
- 4
- Programming Experience
- 5-10
So i am having a little issue with some code i have.. Its inside a timer and when it runs it just keeps the same data never sees that it does an update to the mysql and makes 0 become 1 if there is data there. How do i get it to refresh the sql query so it sees that the data has indeed changed? Here is my code |
VB.NET:
Public Function updateMessageCore()
Connect.ConnectDatabase()
sql_chat_balloon_tip_one = "select * from wp_bp_chat_client_user_core where user_id ='" & login.usrLoggedID & "' and balloon_tip_status = '0'"
Dim balloon_tip_cmd_one = Connect.doCMD(sql_chat_balloon_tip_one)
While balloon_tip_cmd_one.Read()
balloon_tip_data_one &= balloon_tip_cmd_one.GetString(5) & ","
End While
balloon_tip_cmd_one.Close()
Console.Write(balloon_tip_data_one)
'number two call
Dim balloon_break As String = balloon_tip_data_one
Dim balloon_breaks() As String
balloon_breaks = balloon_break.Split(",")
For Each balloon_tips As String In balloon_breaks
sql_chat_balloon_tip_two = "select * from wp_bp_chat_client_message where user_id ='" & login.usrLoggedID & "' and chat_session_id = '" & balloon_tips & "' ORDER BY id DESC"
Dim balloon_tip_cmd_two = Connect.doCMD(sql_chat_balloon_tip_two)
While balloon_tip_cmd_two.Read()
NotifyIcon1.ShowBalloonTip(2000, "New Message", balloon_tip_cmd_two.GetString(3), ToolTipIcon.Info)
Console.Write(balloon_tip_cmd_two.GetString(3))
'doAction("UPDATE wp_bp_chat_client_user_core SET balloon_tip_status = '1' WHERE chat_session_id = '" & balloon_tips & "'")
End While
balloon_tip_cmd_two.Close()
Next
For Each balloon_tips As String In balloon_breaks
doAction("UPDATE wp_bp_chat_client_user_core SET balloon_tip_status = '1' WHERE chat_session_id = '" & balloon_tips & "'")
Next
Connect.DisconnectDatabase()
End Function
Private Sub timer_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles timer.Elapsed
updateMessageCore()
End Sub