Help - Search - Members - Calendar
Full Version: Notification Features?
Webyog Forums > SQLyog > Using SQLyog
rdupree
I'm new to SQLyog, but impressed with its features.

I'm trying to use the notification feature.

I can send myself an email with a Select * from 'xxx' type statements.

Can I use any of the PHP commands to do things like retireve the number of rows in a table?

Any way to list all rows added to a table since the last time the notification was run?

Thanks

Dick
peterlaursen
did you read this FAQ?
http://webyog.com/faq/content/16/4/en/do-i...with-mysql.html.


I do not understand "Can I use any of the PHP commands to do things ...". You use SQL commands, not PHP commands to read or manipulate the database. SQL commmands may be embedded in any language that can connect to MySQL. Not Only PHP, but ASP(.NET), RUBY, PERL, C/C++, JAVA, Delphi(Pascal). The 'parent' language does not really matter - it is the SQL that does.

Am I missing something?

1)
To select the no. of rows:
With Notification service you can "SELECT COUNT(*) FROM a_table" or "SELECT COUNT(some_column) FROM a_table"

2)
This "Any way to list all rows added to a table since the last time the notification was run". You can have a strings column and notifcation can exectute basically 2 statements

SELECT ... FROM a_table WHERE some_column <> 'seen_before'.
UPDATE a_table SET string_column = 'seen_before' {WHERE string_column <> 'seen_before'
(don't forget to mail the results of the SELECT statement)

But you will have to tlet the Nofofications job wirte to the database You may also use a TIMESTAMP column a similar ways



All those questions are SQL questions basically if I understand correctly.

rdupree

Thanks, that information was very helpful. I was thinking along the same track, but wasn't sure if that was the best way to do it. I generally do SQL from PHP then do the logic in PHP, so this is a slightly different way of thinking about things.

I found that I could add text to the report page by using SQL comments. It isn't a complete report writer with lots of formatting features, but should provide the data I need to retrieve and email.

The other option I'm thinking about is to have the chron feature of my ISP host to run a PHP script daily that does SQL queries then generates an email.

Dick
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.