fbpx

findgroupbyname

[insert_php]

$name = $_POST[‘groupname’];
$sql_query = “SELECT * FROM `groups` WHERE `name` LIKE ‘” . $name . “‘”;
$ranked_results = $GLOBALS[‘wpdb’]->get_results($sql_query);

foreach ($ranked_results as $r) {
echo ‘name: ‘ . $r->name;
echo ‘ id: ‘ . $r->id;
echo ‘ room id: ‘ . $r->room;
echo ‘ LINK: ‘ . ‘