Jump to content

[SOLVED] Invalid MySQL result set..


ww_mar

Recommended Posts

Hello everybody,

 

I am seeking help with a mysql/php issue.. (i think this is the best forum, if not please move!). The Issue is described here: http://www.phpbb.com/community/viewtopic.php?f=71&t=1712665 and http://www.phpbb.com/community/viewtopic.php?f=74&t=1717035

 

Here is the create of the table under scrutiny

 

CREATE TABLE  `phpbb_medals_awarded` (
  `id` int(10) NOT NULL auto_increment,
  `medal_id` bigint(20) NOT NULL default '0',
  `user_id` bigint(20) NOT NULL default '0',
  `awarder_id` bigint(20) NOT NULL default '0',
  `awarder_un` varchar(255) character set utf8 collate utf8_bin NOT NULL default '',
  `awarder_color` varchar(6) character set utf8 collate utf8_bin NOT NULL default '',
  `time` int(11) NOT NULL default '0',
  `nominated` tinyint(1) NOT NULL default '0',
  `nominated_reason` text character set utf8 collate utf8_bin NOT NULL,
  `points` smallint(4) NOT NULL default '0',
  `bbuid` varchar(255) character set utf8 collate utf8_bin NOT NULL default '',
  `bitfield` varchar(255) character set utf8 collate utf8_bin NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `time` (`time`)
) ENGINE=MyISAM AUTO_INCREMENT=84 DEFAULT CHARSET=utf8;

 

I have been echoing my query and it is as it is supposed to be and pasting the output of echo into mysqladmin does not give me any problem.

 

Could any of you please ID the problem? Thank you very much..

Best Regards

ww_mar

Link to comment
Share on other sites

Since -

 

$db->sql_query($sql)

 

does not trigger the or die() probably means that it does not return what you think it does and it apparently does not return a FALSE value when a query fails. It would take seeing or knowing what the ->sql_query() method is in order to help, which is why the phpbb forum would be the best place to get help.

 

try -

 

var_dump($result);

 

to see what exactly is in $result.

Link to comment
Share on other sites

Thanks a lot for the advice..! This is the output of var_dump and after that there is an echo of the result.

 

object(mysqli_result)#11 (0) { } 
Object id #11

 

this happens no matter what the query is...all queries give this.. what is this object 11?

 

Thanks a lot for the support.

Link to comment
Share on other sites

Edit: here is my reply even though you seem to have solved the problem while I was writing it -

 

The database interface you are using is mysqli and a successful query returns a mysqli result object.

 

The main problem in the code you are writing is that the mysql_ functions you are using won't work because the database interface is using mysqli. Since the type of database can be selected through phpbb configuration, you need to use phpbb's $db-> class functions for everything associated with a database. You cannot graft on direct database functions because they may not match what is currently selected for the database interface.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.