Apologies for top posting, not sure if this group is top - or bottom posting :-)
I can confirm that this happens, and can be rather random (from memory it used to return a table name of "0" rather than #sql_hex_0) I suggest replacing the 'derived' string with the number '0' to be backwardly (forwardly?) compatible with other releases of mysql. See my notes on https://trac.cakephp.org/ticket/1762 I'm usually on freenode so if anyone wants to discuss just /msg me (opless) regards On Dec 14 2006, 8:53 am, "TT" <[EMAIL PROTECTED]> wrote: > And here is a complete hack if you want custom named values for the > table-names (I use derived) > > function resultSet(&$results) { > $this->results =& $results; > $this->map = array(); > $num_fields = mysql_num_fields($results); > $index = 0; > $j = 0; > > while ($j < $num_fields) { > > $column = mysql_fetch_field($results,$j); > if (!empty($column->table)) { > if (!(strpos($column->table,'#sql_')===false)) > { > $this->map[$index++] = > array('derived', $column->name); > } > else > { > $this->map[$index++] = > array($column->table, $column->name); > } > } else { > $this->map[$index++] = array(0, > $column->name); > } > $j++; > } > } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
