• Hi,

    I was wondering what is the best practices to execute PHP snippet to extract data from MySQL table and displayed in a page?

    There are so many plugins to do so, but I was wondering which is the prefer way and what are the most of people will do for “web applications development” with WordPress 4.3?

    We are going to convert our MODX 1.0 CMS to WordPress 4.3, so I like to figure out how to run PHP and access MySQL first. Thanks a lot.

    Charles

Viewing 3 replies - 1 through 3 (of 3 total)
  • To create/edit/delete custom data into or on-top of WordPress, I like to use the Pods Framework plugin: https://www.ads-software.com/plugins/pods/. In your particular case, you may want to consider using it’s powerful Advanced Content Types which are entirely separate from WordPress and use their own database tables. Do be aware that ACT (Advanced Content Types) can not make use of the full WordPress API as they are indeed a stand-alone data “object” external to WordPress. Learn more about Pods and how to use it at: https://pods.io/

    The other thing to consider when using your own PHP code and database tables is to sanitize and verify everything – you really don’t want to be the target or victim of a SQL Injection attack.

    Thread Starter cyang255

    (@cyang255)

    Hi bemdesign,

    I means there are many php plugins, mysql plugins, so I was wondering how would other more experiences WordPress developers use? What do you guys use? Does WordPress already support them in core? Sorry, I am really new to WP 4.3, so I need to a lot of reading to find out these “basic” stuff.

    Any suggestions on which plugin to use or API to call is very appreciated. Thanks.

    That question is too broad to answer – it is effectively unanswerable because, like most code and application development, it all depends. Generally professional WordPress development (creating your own code to implement functionality) happens through programmers using a code editor/IDE to develop plugins using standard computer science and engineering methodology on top of WordPress’ flexible API. At a high level, it’s just like development for any other application in any other language.

    All that being said, I will point you to the WordPress codex here and the WordPress code reference here. Read through the codex to get an idea of how WordPress architecturally works and then use the developer code reference to delve into the actual functions, classes, methods and hooks used by WordPress.

    Also I recommend opening up the WordPress core PHP files in your PHP/text editor of choice and read through the code which is generally very well documented. Don’t actually edit these files though – it’s always bad practice to edit the core files as they will get overwritten in WordPress updates and you’ll lose your changes. Instead make any customizations through a custom plugins or custom themes.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Execute PHP code and MySQL’ is closed to new replies.