• SheldonNesdale

    (@sheldonnesdale)


    I want to use a value stored as a custom field in a mysql query to a table in my database to set the value of additional variables?

    So far I have used the “PHP Code Experimental” field for my query which is:

    global $fetched_name
    $sql = “SELECT * FROM sites WHERE url = ‘[cts key=website_url]’ “;
    $query = mysql_query($sql, $db);
    while($result = mysql_fetch_array($query)) {
    $fetched_name = $result[“name”];
    }

    And I’m trying to call the variable in the post with:
    [cts key=0]

    But perhaps I am missing a step?

The topic ‘[Plugin: Custom Field Template] php call to database for another variable’ is closed to new replies.