All my site pages located at MYSQL database I want to create a script that exstracting all the data needed for Google site map. And writing it in sitemap.xml Please advice, thank you.
how it is? that sitemap is stored in the mysql - sitemaps are always stored in the root or any accessible location - so that search bots could crawl them - what are you actually using when you say "sitemaps are in mysql"
I meant all my pages information such as page url, title, etc... located in a mysql table and can be extract to xml
You can find an extensive list of sitemap generators here. I'd rather write my own because most of the above mentioned sitemap generators are "crawlers" that crawl your website to generate sitemaps. If your site structure is not suitable for crawlers, neither google bot nor these sitemap generators will be able to crawl the inaccessible pages of your website.
If you have all your data in SQL tables, you will probably need to write a script yourself to extract it. However, you can also use automate sitemap generator to crawl your website, but obviously that is slower than reading directly from SQL tables