php-mysql website - problem design solution
Dear,
I have purchased the above wrox book. I am using the concepts covered in the book for my website. i have the following 4 pages.
1. details.class.php
====================
// users pear DB
// count no of records on the
// foreign table named details
function countRecords($i) {
// returns no. of records
}
// returns array of records
// based on $i, which is an
// integer passed from details.php
function getDetails($i) {
}
2. master.php
=============
// $i return record no. from
// my sql database from a
// master table
// some php code here
<a link='details.php&i=' ?php print clean($i)>Details</a>
3. details.php
==============
require once (class.details.php);
require once (elements.php);
// get array of records from
// details.class.php
$aDetails = details->getDetails($i);
// get the count of record to
// know how much records will be
// returned for rendering
$iCount = details->countDetails($i)
// render page uses function from
// elements.php
$renderlist($iCount, $aDetails);
4. elements.php
===============
function renderlist($iCount, $aDetails) {
// render html code used for rendering here
}
After parsing the pages, though after the
variable $i returns the correct master record
no. on the details.php page, i dont get the
expected records from the foreign table on
the page.
also the master record which is supposed to
display a header always returns the record
no 1 irrespective of whatever record no the
variable $i have picked up.
my sql is correct as the same text return
the required record when i checked on the
phpmyadmin GUI.
can you please guide me on what is going
wrong? thanks in anticipation.
CJBGUY
__________________
CJBGUY
|