How to handle zero rows found - invalid $output
How to handle zero rows found - invalid $output
Hi,
I'm afraid I need to request some help once again:
I have a fairly simple table that is populated by PHP/MySQL:
[code] <?php
include('conn.php');
$plyrno = $_GET['playerno'];
$aColumns = array( 'HPplayerID', 'honname', 'HPseasonID' );
$sQuery = "
SELECT SQL_CALC_FOUND_ROWS
HPplayerID,
honname,
HPseasonID
FROM table1 a, table2 b
WHERE a.HPplayerID = $plyrno
AND a.HPhonourID = b.honourID
";
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$row = array();
for ( $i=0 ; $i
I'm afraid I need to request some help once again:
I have a fairly simple table that is populated by PHP/MySQL:
[code] <?php
include('conn.php');
$plyrno = $_GET['playerno'];
$aColumns = array( 'HPplayerID', 'honname', 'HPseasonID' );
$sQuery = "
SELECT SQL_CALC_FOUND_ROWS
HPplayerID,
honname,
HPseasonID
FROM table1 a, table2 b
WHERE a.HPplayerID = $plyrno
AND a.HPhonourID = b.honourID
";
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$row = array();
for ( $i=0 ; $i
This discussion has been closed.
Replies
Allan
yes, that's what I thought. But I just 'blindly' copied the routine from a previous post and haven't determined how to amend it yet.
[code] $rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
$total_results = mysql_num_rows($rResult);
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$row = array();
for ( $i=0 ; $i
[code]
$output = array( 'aaData' => array() );
[/code]
Allan
thanks once again - I now get a nice 'no data available in table' message rather than the row of zeroes I'd created.