<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 10/29/2014	ELL
// 
// 
	include ("./check_session.php");
	
	$table = $_POST['table'];
	$user_name = $_POST['user_name'];
	
	if ((!$table) || ($table == ""))
		$query = "SELECT * FROM `" . BWB_TABLE_PREFIX . "users` WHERE `UserID` = '" . $user_name . "'";
	else
		$query = "SELECT * FROM `" . $table . "` WHERE `UserID` = '" . $user_name . "'";
		
	$result = $bwb_dbh->query($query);
	
	if ($result->rowCount() < 1)
	{
		echo "-no data-";
		exit;
	}

	$row = $result->fetch(PDO::FETCH_ASSOC);
	$user_row = json_encode($row);
	
	echo $user_row;
?>