[TYPO3] php help with writing to the sql database.

dave typo typothree at gmail.com
Wed Jun 27 14:34:21 CEST 2007


Currently, I am trying to make it so users can insert an overlay of text
onto images that are being processed by hl_dam_gallery. I am merging the
components of another extension, the Image Localization Overlay, with
hl_dam_gallery. Localization overlay uses gifbuilder under its typoscript
setup

Essentially, I'm trying to make the scaled hl dam gallery images be
integrated with gifbuilder, exactly how the localization overlay extension
works.

I feel like I am close to getting it working. However,

I keep getting this error

2: SQL error: 'Unknown column 'tx_hldamgallery_fontsize' in 'field list''
(tt_content:387)


after saving the gallery.

and do not understand why. I believe that the problem lies in my
class.tx_hldamgallery.php file, as my ext_tables php file and the local lang
files seem to be doing what they should be doing.

So, I was wondering the correct syntax to link to a database.
In my ext_tables.php file, under tca I have:

$TCA['tt_content']['palettes']['13']['showitem'] =
$TCA['tt_content']['palettes']['13']['showitem'] .
        ', tx_hldamgallery_squarethumbs, tx_hldamgallery_xcoord,
tx_hldamgallery_ycoord, tx_hldamgallery_fontsize,
tx_hldamgallery_lineheight, tx_hldamgallery_color, tx_hldamgallery_text';

where tx_hldamgallery_xcoord etc are the newly added array tables. (ie make
thumbnails a square, have the x coordinate for the gifbuilder text, the y
coordinate, enter the font size, the lineheight, the color, and then the
text itself.

This is what I have for attempting to pass the number (the x coordinate for
the gifbuilder text) of tx_hldamgalery_xcoord under the
class.tx_hldamgallery.php

$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_hldamgallery_text,
tx_hldamgallery_xcoord, 'tt_content', 'uid=' . $galleryCID . ' and pid = ' .
$galleryPID, '', '', '');
                     if ($res) {
                      $row = $GLOBALS['TYPO3_DB']->_fetch_assoc($res);
                      $text = $row['tx_hldamgallery_text'];
                      $xcoord = $row['tx_hldamgallery_xcoord'];
                      }
//row refers to the array name in the ext_tables file.
//and then later in the file we have :

if ($res && is_int($xcoord) {
            $x = $this->lConf['xcoord'];
            }

// so if $res is passed and if the x coordinate is an integer, than write x?


Is that correct syntax to pass the numeric value to the database?  Also, I
can't find any tables in mysql for the extension, so I have not created any
new tables to reflect my changes. Could this be a problem?


please, any help or php help is greatly appreciated.




thanks,


-Dave


More information about the TYPO3-english mailing list