PHP Classes

Show selected result

Recommend this page to a friend!

      Simple db class  >  All threads  >  Show selected result  >  (Un) Subscribe thread alerts  
Subject:Show selected result
Summary:How do I show the result after having selected the information
Messages:1
Author:Marthinus Viljoen
Date:2009-04-06 09:27:46
 

  1. Show selected result   Reply   Report abuse  
Picture of Marthinus Viljoen Marthinus Viljoen - 2009-04-06 09:27:47
I am using the Class as-is just adding my own database credentials and identification. I am completely new to PHP and would like to know something.

See below my script to see how I bodged things up...

How do I display the results from my SQL statement?


<html>
<head><title>Verify Person</title>
<link rel="stylesheet" href="CSS/Pigeon.css">
</head>
<body>
<?php
Require_Once "Class/class.database.php";

$PID = $_POST['PID'];
$PPAS = $_POST['PPAS'];
echo $PID .' <br><br>';

$SSQL="select a.PERSON_ID
,a.FULL_NAMES
,a.NICK_NAME
,a.SURNAME
,a.DATE_OF_BIRTH
,a.CURRENT_FEES_PAID
,a.DATE_LAST_FINANCIAL
,a.PICTURE_PATH
from person a
where a.PERSON_ID = ".$PID."
and a.PERSON_STATUS = 1;";

echo $SSQL . '<br>';

$DB = new database();
$DB->select($SSQL);


echo rows . ' row(s) selected.<br><br>';


echo "<table>";
echo "<th><td><b>Person ID</b></td><td><b>Full Names</b></td><td><b>Nick Name</b></td><td><b>Surname</b></td><td><b>Date of Birth</b></td><td><b>Fees Paid</b></td><td><b>Date Last Payment</b></td><td><b>Picture</b></td></th>";
for ($i = 0; $i < $S->$rows; $i++)
{
echo "<TR>";
for ($j = 0; $j < 8; $j++)
{
echo "<TD>" . $S->$arReturn[$j] . "</td>";
}
echo "</tr>";
}
echo "</table>";

?>
</body></html>