Undefined offset: 1 ERROR
Posted: Wed Oct 11, 2006 2:49 am
Alrighty; well like the title says; the error I'm getting is this:
Notice: Undefined offset: 1 in D:\XXXXXX\Web_Pages\Object_Library\Result_Fields\results.php on line 47
The code goes like this. I'm parsing most of an SQL query to this webpage (results.php). The query for simplicity is as follows:
select student.name from students;
The code in results.php then adds a "LIMIT" and "ORDER BY" paramater at the end of the query like this:
NOTE also that $titles is an array parsed to results.php along with $sql_query
Any ideas???
Thanks
Notice: Undefined offset: 1 in D:\XXXXXX\Web_Pages\Object_Library\Result_Fields\results.php on line 47
The code goes like this. I'm parsing most of an SQL query to this webpage (results.php). The query for simplicity is as follows:
select student.name from students;
The code in results.php then adds a "LIMIT" and "ORDER BY" paramater at the end of the query like this:
Code: Select all
//$sql_query="select student.name from students";
//$titles=array("Student Name");
/*stores the column number to be sorted */
if(@!empty($_GET['column'])) $column=$_GET['column'];
else $column = 1;
$LIMIT=($num_results*$current_page) - $num_results;
/*Query to select information from the database */
$sql_query.=" LIMIT '{$LIMIT}'
<<Line 47>> ORDER BY '{$titles[$column]}' '{$order}'";Any ideas???
Thanks