I need to do a special query on one of my web pages. I need to know how to turn a return from exp:weblog:entries into a variable to be used in a php query. I specifically need the entry_id number
Something like this:
{exp:weblog:entries weblog="friends"}
{name}
(Grab The Entry_Id of the printed name and make it into Entry_Id of name = $name)
{/exp:weblog:entries}
<?php
// CONNECT TO DATABASE //
include('/home/connect.php');
$dbc = @mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die ('Could not connect to MySQL: ' .mysqli_connect_error());
$q = "SELECT entry_id FROM exp_weblog_data WHERE field_id_10='$name'";
$r = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n
MySQL Error: " . mysqli_error($dbc));