Categories > TinyButStrong general >

Another Merge Error

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Radeon
Date: 2004-09-28
Time: 18:36

Another Merge Error

TinyButStrong Error (MergeBlock [glr]): Unsupported variable type : 'NULL'.

Why do i get this?
I have gone trough my code atleast a hundred times and i can't get why it does this....

PHP:
function imageAdd() {

       $id = $_GET['id'];
       $query_glr = "SELECT * FROM site_gallery WHERE gallery_id='$id'";

       $TBS = new clsTinyButStrong;
       $TBS->LoadTemplate('html/admin_image_add.html');
       $TBS->MergeBlock('glr', $db, $query_glr);
       $TBS->Show();
     }

HTML:

<tr><td><table cellpadding="4" cellspacing="0" width="408" class="table_01">
<form method="post" action="?action=add&id=[glr.gallery_id]">
<tr><td class="text_02" valign="middle" width="50">Name</td><td>
<input class="box" size="60" type="text" name="img_title" /></td></tr>
<tr><td class="text_02" valign="middle" width="50">File</td><td>
<input class="box" size="45" type="file" name="img_file" /></td></tr>
<tr class="text_02"><td valign="middle" width="50">Gallery</td><td>
<b>[glr.gallery_title]</b></td></tr>
<tr><td></td><td><input type="submit" class="button" value="Insert Image" /></td></tr>
</form>
</table></td></tr>

Any help appriciated!
By: Skrol29
Date: 2004-09-28
Time: 19:15

Re: Another Merge Error

Hi,

That's because variable $db is null.
Placed is your function, it is a local variable.
You should add
  global $db;

By: Radeon
Date: 2004-09-28
Time: 20:20

Re: Another Merge Error

Great, thx! Damn, it's always small thing like that you miss yourself :D