Jump to content

Cant understand why doesnt work, printing a record in an array


deansaddigh

Recommended Posts

<?php

include('../lib/scripts/php/functions.php');

$page_title='Clients';
$page_id_top = 'clients';
$page_id = 'viewClients';

include('../lib/includes/header.php');


if (!empty($_GET['page']))
{
	$page = $_GET['page'];
}
else
{
	$page = 1;
}

$limit =  20;





unset($_SESSION['cottage']);

?>
                    <div id="sub_nav">
		<? include('subnav.php');

		if (!empty($_POST['search']))
		{
			$search = $_POST['search'];
			$clientSQL = "SELECT * FROM clients WHERE name like '%$search%' OR surname like '%$search%' OR email like '%$search%' OR address1 like '%$search%' OR town like '%$search%' OR postcode like '%$search%'OR county like '%$search%'";
			$limit =  500;
		}
		else			
		{
			$clientSQL = "SELECT * FROM clients WHERE name != '0'
       		 		      $cottageSQL
				      $sortSQL";
		}

		$clientsResults = $db->query($clientSQL);
		echo $clientResults;
		$total_clients = count ($clientsResults);
		$total_pages = ceil($total_clients / $limit);
		$set_limit = 1;
		$set_limit = $page * $limit - ($limit);
		$limitSQL = " LIMIT $set_limit,$limit"; 

		$clientSQL = $clientSQL.$limitSQL;

		$clientsResults = $db->query($clientSQL);




?>

                    </div>
                    <div id="content">
                    	<div id="content_tab">
			<!--START OF PAGE TABS-->
  				<? include('tabs.php');?>
                                <!--END OF PAGE TABS-->
                        </div>
                        <div id="content_contents">
                        <!--START OF PAGE CONTENT-->
      			
	  
<?			if (!empty ($clientsResults))
		{

		foreach ($clientsResults as $clientsResults2)
		{
?>
		<div class="productItem">
			<div class="productItemImage"><img src='images/client_icon.gif'></div>
                                <div class="productItemDescription">
                                	

                                    	<table border='0'>
                                        <tr>
				<td width="130px">Name:</td>
				<td width="270px"><?=$clientsResults2{'title'}.' '.$clientsResults2{'name'}.' '.$clientsResults2{'surname'}?></td>  					
				</tr>
				<tr><td></td></tr>
				<tr>
                                        	<td>Email address:</td>
					<td><?=$clientsResults2{'email'}?></td>					      
				</tr>
				<tr>
                                        	<td>Telephone:</td>
					<td><?=$clientsResults2{'telephone'}?></td>					      
				</tr>					
				<tr>
                                        	<td>Last booking:</td>
					<td><?=$clientsResults2{'arrival_date'}?></td>

 

 

This line doesnt do anything

 

<td><?=$clientsResults2{'arrival_date'}?></td>

[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.