Opened 14 years ago

Closed 14 years ago

#5864 closed defect (fixed)

benchReceive.php syntax error

Reported by: bill Owned by: dante
Priority: high Milestone:
Component: Dijit Version: 1.0
Keywords: Cc:
Blocked By: Blocking:


From ... 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);

        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.

Change History (1)

comment:1 Changed 14 years ago by dante

Resolution: fixed
Status: newclosed

(In [12457]) fixes #5864 - syntax error. maybe its time to target these results at ?

Note: See TracTickets for help on using tickets.