Output placement

Hello everyone, I am writing a small php/mssql based program at work and and coming across a few problems and would love to get some advice. The first issues i think is a smaller one, but I have a table for police codes, those codes come in 3 different categories: ‘10 codes’ , ‘admin signals’, and ‘action codes’. I have them printing to the screen in 3 separate query’s so they will output in their specific categories. I am trying to make the categories labeled ‘10 codes’ output to the left side of the screen by themselves, and the other 2 categories line up under each other on the right side, even with the left.

right now i’m having an issue making that happen the right way. i cant seem to line everything up. I was wondering if you guys have any advise on lining up the output properly, and if there is a better way to run the query’s?

[php]<?php include 'head.php'; ?>

<?php include 'header.php'; ?>
<div id="site_content">

  <div id="content">
   <h1>In process of fixing output</h1>
   <h1>Police 10 Codes: List</h1>

10 Codes

<?php

include ‘connect.php’;

$query = "SELECT * FROM CodesPolice WHERE category = '10 Codes' ORDER by 'code' asc";
$resource=sqlsrv_query($conn, $query) or die(print_r(sqlsrv_errors(), true));

echo "

"; while($result=sqlsrv_fetch_array($resource)) { echo " "; } ?>
Code Description
".$result['code']." ".$result['description']."

Administrative Signals

<?php
$query = "SELECT * FROM CodesPolice WHERE category = 'Administrative Signals' ORDER by 'code' asc";
$resource=sqlsrv_query($conn, $query) or die(print_r(sqlsrv_errors(), true));

echo "

"; while($result=sqlsrv_fetch_array($resource)) { echo " "; } ?>

Action Codes

<?php
$query = "SELECT * FROM CodesPolice WHERE category = 'Action Codes' ORDER by 'code' asc";
$resource=sqlsrv_query($conn, $query) or die(print_r(sqlsrv_errors(), true));

echo "

	<tr align = 'left'>
		<th><u>Code</u></th>
		<th><u>Description</u></th>
	</tr>

";
while($result=sqlsrv_fetch_array($resource))
{
echo "

"; } ?>
Code Description
".$result['code']." ".$result['description']."
".$result['code']." ".$result['description']."
<?php include 'footer.php'; ?> [/php]

If you set the width, I don’t know if you have, of the forms, You can then use CSS to float them next to each other.

Sponsor our Newsletter | Privacy Policy | Terms of Service