Ajax and mysql DB (3 posts)

  1. domainmadness
    Posted 4 years ago #

    First of all, I do not have much coding knowledge. I barely can modify others scripts.

    That being said, I hired a coder to do an ajax form for me that fetch information from mysql database. It works fine on plaing html site, but now I'm trying to implement that into wordpress also. With no luck.

    I can integrate my other db with wordpress if necessary. I'll paste few lines here, which I think might be the problem. Thanks for correcting :)

    $connect = mysql_connect($host,$username,$password)or die("<hr>Can't connect server". mysql_error()) ;
    mysql_select_db($db,$connect) or die("Can't connect database");

    $query = mysql_query($sql) or die('error');

    while ($object = mysql_fetch_object($query))

    Are these correct?

  2. Tom Morton
    Posted 4 years ago #

    WordPress has methods to pull data from the database without the need to query it directly. For example, querying a post: query_posts

    That being said, whatever you are trying to show in ajax can still be displayed using these methods. Here are a few links to ajax and WordPress related tutorials/articles. Hope they help!


  3. domainmadness
    Posted 4 years ago #

    Thanks for your reply.

    Tried to read those a bit, but I'm so overwhelmed when trying to understand all the info that it would take me weeks/months to get this done.

    Would appriciate a lot if someone could walk me trough...

    [ Please do not bump, it's not permitted here. ]

Topic Closed

This topic has been closed to new replies.

About this Topic