Ticket #5864 (closed defect: fixed)
benchReceive.php syntax error
| Reported by: | bill | Owned by: | dante |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Dijit | Version: | 1.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
From http://www.dojotoolkit.org/forum/dijit-dijit-0-9/dijit-development-discussion/php-syntax-error-one-dijit-files ... although do we even use that file anymore? Or is it just a half finished project? Here's the text from the wiki post:
I just got acquainted with dojo yesterday, it caught my interest, so I started reading on the manual. Today I've started to create my first project, as my IDE (Eclipse) pointed to an error in one of php-files. It's the file %DOJO_ROOT%/dijit/bench/benchReceive.php
Symbol "}" on line 124 or 125 should be removed, since one of them is unnecessary. In case you need full function syntax:
function add_rec($table, $data) {
if (!is_array($data)) { return FALSE; }
$keys = array_keys($data);
$values = array_values($data);
$field=0;
for ($field;$field<sizeof($data);$field++) {
if (!ereg("^[0-9].*$",$keys[$field])) {
$sqlfields = $sqlfields.$keys[$field]."="".$values[$field]."", ";
}
}
$sqlfields = (substr($sqlfields,0,(strlen($sqlfields)-2)));
if ($query = mysql_query("insert into $table set $sqlfields")) {
$id = mysql_insert_id();
return ($id); } else { return FALSE; }
}
}
As you can see, last IF statement is already closed right after "return FALSE;", so one of two "}" in last two lines should be taken out.