PHP Classes

Odd Error

Recommend this page to a friend!

      phpMyDataGrid - AJAX Enabled Datagrid  >  All threads  >  Odd Error  >  (Un) Subscribe thread alerts  
Subject:Odd Error
Summary:Parse error: parse error, unexpected $end
Messages:7
Author:brian janaszek
Date:2006-07-22 20:12:10
Update:2007-02-26 00:05:11
 

  1. Odd Error   Reply   Report abuse  
Picture of brian janaszek brian janaszek - 2006-07-22 20:12:10
I'm excited by the functionality in this class, but I'm having a problem:

Parse error: parse error, unexpected $end in C:\work\includes\phpMyDataGrid.inc.php on line 1230

(Note: I've made no changes to the phpMyDataGrid class).

Below is the code I'm using (mostly a copy & paste from an example):

<?php
// include ("../includes/check_user.php");
define('VDAEMON_PARSE', false);
include('../includes/constants.php');
include('../includes/db_functions.php');
require_once("../includes/phpMyDataGrid.inc.php");
include_once("../includes/mylibrary.inc.php");
db_connect();
include("../includes/admin_functions.php");


?>
<html>
<head>
<title>Schools</title>
</head>
<body>

<?php
$Browse = new datagrid();
$Browse -> debug("1");
// Additions to class
$Browse -> noorderarrows() ; // Calling this function, The Grid will not show ordering arrows v/^
//$Browse -> where("productmodel_id>='1'"); // Now you can filter records using where clause
//$Browse -> definecolor("white","blue", "yellow", "red"); // Define colors to use in datagrid
//$Browse -> botones("1"); // if you call this function, the Add, modify and delete buttons will not be visible.
$Browse -> buttons(true,true,true);//insert, update,delete
$Browse -> TituloGrid("Schools"); // Title for datagrid.
$Browse -> sqlstatement("select * from school_list"); //for display
//$Browse -> campos("prolongatie_id, netto , productvolume , productmodel_id"); // list of fields to browse delimited by comma ( , , )
$Browse -> tabla("school_list"); // tablename for update insert or delete
$Browse -> IDfield("SchoolID"); // Principal key: This field MUST be listed in $above->Campos();
$Browse -> orderby("SchoolName","ASC"); // First order field to view datagrid (ASC or DESC)
$Browse -> autofield("SchoolID"); // Use this call if you have an autoincremental field
// FormatColumn(Field, Title, text field Width, MaxLength, inputtype (0=text 1=readonly 2=hidden) , Column size, $lign (center, left, right), mask (see function for details)
$Browse -> FormatColumn("SchoolID","School ID", "3", "3", "2","10","left","integer"); // Format for each field. Each call is for one field,
$Browse -> FormatColumn("SchoolName","School Name", "50", "50", "0","10","left","text"); // Format for each field. Each call is for one field,
$Browse -> FormatColumn("CampusCode","Campus Code", "50", "50", "0","10","left","text");
$Browse -> StyleTable("width:900; border:solid; border-width:1;border-color:red;");
$Browse -> StyleRows("border:solid; border-width:0; border-color:blue;");
// $Browse -> datarows(20);
$Browse -> ajax('silent'); // Call this function if you want Ajax Editable fields must be set just before grid()

//$Browse -> searchby ("SchoolName");
$Browse -> grid(); // draw the grid.

?>
</body>
</html>

Am I missing something obvious?

Thanks
brian

  2. Re: Odd Error   Reply   Report abuse  
Picture of LE RAT LE RAT - 2006-07-24 08:53:20 - In reply to message 1 from brian janaszek
I'm a user of phpmydatagrid script.
I've tried your script without the extra included php.
I have no syntax problem.
But, the ID field does not appears as input field even if we don't specify the autofield.

With the autofield function, It's working well.

May be, the syntax error come from the extra included file?

$Browse -> autofield("SchoolID");

create table school_list (SchoolID int not null auto_increment ,
(50) null, CampusCode char(50) null, primary key (`SchoolID`));

I've used the conectadb function. Is it possible to get rid of this function?


  3. Re: Odd Error   Reply   Report abuse  
Picture of brian janaszek brian janaszek - 2006-07-27 10:59:04 - In reply to message 2 from LE RAT
Thanks for your reply. I will look into it.

This class is compatible with PHP 5, correct?

  4. Re: Odd Error   Reply   Report abuse  
Picture of sujith sujith - 2006-08-11 11:34:04 - In reply to message 3 from brian janaszek
Did u solved your problem?

I am also getting the same
"
Parse error: parse error, unexpected $end in C:\Typo3\htdocs\phptest\data\examples\phpMyDataGrid.inc.php on line 1230"

Please let me know how did u solved
sujithukvl@gmail.com

  5. Re: Odd Error   Reply   Report abuse  
Picture of sujith sujith - 2006-08-12 13:09:13 - In reply to message 4 from sujith
IT IS ME MYSELF REPLAYING TO ME :)
THIGS WILL BE OK
IF I REPLACE "<? "WITH "<?php"

(Take care the <? with in java script shuld not be
replace)
sujithukvl@gmail.com

  6. Re: Odd Error   Reply   Report abuse  
Picture of David Bunker David Bunker - 2006-11-14 12:02:00 - In reply to message 5 from sujith
I've got the same error. I've made sure the code is "<?php" at the start of the script but it still errors at line 1230 which is the last line!
Any ideas?

  7. Re: Odd Error   Reply   Report abuse  
Picture of jeff g jeff g - 2007-02-26 00:05:11 - In reply to message 6 from David Bunker
Alas, I still can't resolve the problem that everyone has described here.

I also added php to the beginning of the file....

Did anyone come up with a solution for this?

Please email me at manhattanguy at gmail dot com

Thanks!

Jeff