[support] Error when execute query

bharani kumar bharanikumariyerphp at gmail.com
Sun Feb 14 19:17:23 UTC 2010


in setting .php i changed ,

mysqli to mysql ,


now prob fixeds,

thanks

On Mon, Feb 15, 2010 at 12:19 AM, Buddhika Laknath <blaknath at gmail.com>wrote:

> This is because of this line of code.
>
> $block['content'] = $alphabetical_search_result;
>
> Where your $alphabetical_search_result is a mysql result resource object
> and Drupal expects instead a string.
>
> Change the above line to something like this.
>
>
> while ($line = db_fetch_object($alphabetical_search_result){
>    $block['content'] += $line->some_text_feild_in_database;
> }
>
> -Laknath
>
> bharani kumar wrote:
> >
> >
> > Hi i got error
> >
> > recoverable fatal error: Object of class mysqli_result could not be
> > converted to string in
> > F:\wamp\www\vijaishopping\themes\garland\block.tpl.php on line 10.
> >
> >
> > Hi i tried custom module, it through the error ,
> >
> > What i do now,
> >
> > my snippet below
> >
> > <?php
> >
> > function alphabeticalsearch_block($op = 'list', $delta = 0, $edit =
> > array()){
> >
> >      if($op == "list") {
> >             $block = array();
> >           $block[0]["info"] = t('Alphabetical Search');
> >         return $block;
> >       }
> >   elseif($op == 'view'){
> >     $alphabetical_search_result = db_query("SELECT node.nid AS nid,
> > node.title AS node_title,   node_revisions.body AS node_revisions_body,
> >               node_revisions.format AS node_revisions_format FROM node
> > node LEFT JOIN node_revisions node_revisions
> >               ON node.vid =    node_revisions.vid where node.title
> > like '%a'");
> >
> >      $block['subject'] = 'Click to send request';
> >      $block['content'] = $alphabetical_search_result;
> >     return $block;
> >   }
> >
> > }
> >
> >
>
>
> --
> I blog at http://mytechgossips.com
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>



-- 
Regards
B.S.Bharanikumar
http://php-mysql-jquery.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20100215/54ed8e82/attachment-0001.html 


More information about the support mailing list