Support » Plugins » Using Existing PHP/MySQL Table

  • Hi Everyone,

    I’m considering using WordPress to convert a couple of existing web site’s.

    They have existing pages that access data from a MySQL database, such as categorized products, links & various other types.

    Can I simply add the custom tables to the WordPress Database and use my existing PHP code to re-create these pages or am I forced to use the WordPress Database API (wpdb) ( ezSQL ) ?

    TIA, Dave Porter

Viewing 7 replies - 1 through 7 (of 7 total)
  • I think it’d be wiser to write a little export script. It shouldnt take much time if the old db structure is not too complicated.

    Thanks Kovshenin,

    Perhaps I was not clear – I can easily export the data from the old database to a new table in the WordPress database…
    ( using phpMyAdmin or similar )

    I would start from scratch with the new site, pick a suitable template, copy over the static content etc…

    But I was wondering about using the existing pages code ( PHP ) to recreate the pages that have mySQL content in a wordpress page.

    It would just be a time saver. I will learn the $wpdb class given time !

    regards, Dave

    DavePorter, oh I see. Well, you might just use your php files and access them directly on The wordpress permalink feature omits rewriting if file or directory exists.

    OK, Thanks

    If I create a new Plugin and just have a function that has the existing PHP code in it will that work ?

    cheers Dave

    It will, although you might just write the code in functions.php. Or perhaps have ready-to-include php files, then use the PHP-Exec plugin to include() certain files in the right places. Not sure it makes sense though…

    Yes that makes sense…
    Thank you I will experiment and see how I go.

    regards, Dave

    You’re welcome.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Using Existing PHP/MySQL Table’ is closed to new replies.