Writing Mysql and Php code in wordpress Posts

With a stock WordPress install, you cannot insert server side code like PHP directly into a post, only HTML-compatible text. Using the [code][/code] shortcode only outputs what is inside as PRE and CODE elements of HTML, useful for showing code to your readers. In general, it is a bad idea to put code directly into a post.

Thank being said, there are several plugins that will give you this capability. See the following: