Categories > TinyButStrong general >

BLOB Field Problem

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Ronei
Date: 2009-08-10
Time: 21:04

BLOB Field Problem

Good afternoon staff, once again I would like help from you, I have a Table of Firebird in a field of type BLOB SIZE = 80 = TEXT SubType, but returns to the field through a

$ TBS-> MergeBlock ( 'blk_select_sae01', $ conn, $ sql_p_sae01)

of the following error:

Warning: ibase_query () [function.ibase-query]: Dynamic SQL Error SQL error code = -104 Token unknown - line 7, char 27. in C: \ XAMPP \ htdocs \ go \ TBS \ plugins \ tbsdb_firebird.php on line 17

TinyButStrong Error when merging block [blk_select_sae01]: tbsdb_firebird_open function () has failed to open query ()

Well finally the question as the return type BLOB field?

I hope I help!
By: Ronei
Date: 2009-08-14
Time: 15:13

Re: BLOB Field Problem

   
My friends, there is someone who can help me?

I would like a solution, based on TBS!
By: TomH
Date: 2009-08-15
Time: 16:41

Re: BLOB Field Problem

It really appears to me to be a database error - not TBS error.

If you showed your db query code maybe someone might spot an error - but really you need to run straight PHP to prove your db connection and db query are producing the expected result before you can work on the TBS code.

Sorry, that's what it looks like to me,
TomH
By: Ronei
Date: 2009-08-15
Time: 22:35

Re: BLOB Field Problem

TomH Good afternoon, I q is not more error in code, I will post the code

--This is the connection with the database
$conn = ibase_connect('localhost:D:\BDSIGA.FDB','SYSDBA','masterkey','ISO8859_1');

--This is the search

$sql_pesq_sae01 = "SELECT SAE01.AE_FILIAL, SAE01.AE_IDALUNO, 
                              SAE01.AE_IDCURSO, SAE01.AE_OBS
                              FROM SAE01
                              WHERE SAE01.AE_IDALUNO = ". $_SESSION['id_set']."
                             AND  SAE01.AE_IDCURSO = ".$_SESSION['cursopric']."";

--This is the field of type BLOB, I'm trying to display the HTML = SAE01.AE_OBS

--This block is TBS

if ($_REQUEST['form'] == '9TOI'){
  $TBS->MergeBlock('blk_select_sae01',$conn,$sql_p_sae01);};
By: TomH
Date: 2009-08-16
Time: 01:14

Re: BLOB Field Problem

I don't see probs in your query statement - as long as both of the SESSION vars are numeric.

I still think the error is database related.

Verify that you are getting a valid connection, something like...
if($conn = ibase_connect('localhost:D:\BDSIGA.FDB','SYSDBA','masterkey','ISO8859_1')) {
echo "Connection Good";
}else{
echo "No Connection";
}

If the connection is okay then also verify that you are getting a valid result, something like...
$result = ibase_query($conn, $sql_pesq_sae01) or die(ibase_errmsg());

if ($_REQUEST['form'] == '9TOI'){
  $TBS->MergeBlock('blk_select_sae01',$result);};

By: Ronei
Date: 2009-08-16
Time: 01:44

Re: BLOB Field Problem

Good night TomH, really there is no problem in the research and not in connection to the database, the problem I see is that the TBS does not return data from a field of type BLOB, if I return this field by PHP, see how I did:

<?PHP
  global $obs_his;
 
  $sql_pesq_sae01 = "SELECT SAE01.AE_FILIAL, SAE01.AE_IDALUNO, SAE01.AE_IDCURSO, SAE01.AE_OBS
                    FROM SAE01
                    WHERE SAE01.AE_IDALUNO = ". $_SESSION['id_set']."
                    AND  SAE01.AE_IDCURSO = ".$_SESSION['cursopric']."";
                     
  $result = ibase_query($conn, $sql_pesq_sae01) or die("<center>Base login de dados não existe</center>");
  $row = ibase_fetch_assoc($result);
 
  $binfo = ibase_blob_info($row['AE_OBS']);
  $bopen = ibase_blob_open($row['AE_OBS']);
  $obs_his = ibase_blob_get($bopen, $binfo[0]);

  //echo $sql_pesq_sae01;
?>

Works perfectly well as a step to the result global variable and return it in HTML, but I wonder if his own TBS can not return this type of field.

now thanks for help.
By: TomH
Date: 2009-08-16
Time: 13:59

Re: BLOB Field Problem

A couple of points...
(1) I don't have ibase to work with - but I googled 'ibase blob' and found immediately that there's a potential problem with PHP bug see
http://bugs.php.net/bug.php?id=41429 and other postes.
(2) From the PHP docs I wonder if access to ibase blob content requires a second step in the PHP code to get to the content -- or the query needs to be retrieved as an object so that you can access the contents of the blob.
TBS can address the individual components inside of an object (or array inside an array) using the "." notation from docs
You can also merge array's items, object's properties or object's methods using a dot (".") as separator. Resource variables are ignored.
For example (valid for both [onload], [onshow] and [var]):
[onshow.tbl.item1]           will display           $tbl['item1']
[onshow.tbl.item2.a.0]           will display           $tbl['item2']['a'][0]
[onshow.obj.prop1]           will display           $obj->prop1
[onshow.obj.methA]           will display           $obj->methA()
[onshow.obj.methB(x,y)]           will display           $obj->methB('x','y')
[onshow.tbl.item3.prop2.item4           will display           $tbl['item3']->prop2['item4']
Versioning: calling methods with arguments from an automatic field is supported since TBS version 3.0.
By: Ronei
Date: 2009-08-17
Time: 15:05

Re: BLOB Field Problem

   
Morning TomH, sorry more did not understand your example, could give an example using my code, if possible, if not, I will continue to use like this.

Now thanks for help