ww_mar Posted July 30, 2009 Share Posted July 30, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/168204-solved-invalid-mysql-result-set/ Share on other sites More sharing options...
abazoskib Posted July 30, 2009 Share Posted July 30, 2009 if you are simply echoing the query then of course it will not work. You need to connect to your database with PHP and then use mysql_query($queryString); where $queryString is equal to your query. Check out the PHP manual. Quote Link to comment https://forums.phpfreaks.com/topic/168204-solved-invalid-mysql-result-set/#findComment-887244 Share on other sites More sharing options...
ww_mar Posted July 30, 2009 Author Share Posted July 30, 2009 Are you joking? Please read the links I posted.. Quote Link to comment https://forums.phpfreaks.com/topic/168204-solved-invalid-mysql-result-set/#findComment-887264 Share on other sites More sharing options...
Philip Posted July 31, 2009 Share Posted July 31, 2009 It is unlikely you're going to get a reply here since you are messing with phpBB's functions. Their forum is the best place to place your question, and patiently wait for a reply. Quote Link to comment https://forums.phpfreaks.com/topic/168204-solved-invalid-mysql-result-set/#findComment-887309 Share on other sites More sharing options...
ww_mar Posted July 31, 2009 Author Share Posted July 31, 2009 they say to ask you, you say to ask them Thanks, anyway. Best Regards Quote Link to comment https://forums.phpfreaks.com/topic/168204-solved-invalid-mysql-result-set/#findComment-887336 Share on other sites More sharing options...
abazoskib Posted July 31, 2009 Share Posted July 31, 2009 Are you joking? Please read the links I posted.. oopsies. well, what is the query(im not sure if you meant the creation of that table is giving you a problem), and/or what warnings are you getting? Quote Link to comment https://forums.phpfreaks.com/topic/168204-solved-invalid-mysql-result-set/#findComment-887390 Share on other sites More sharing options...
PFMaBiSmAd Posted August 2, 2009 Share Posted August 2, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/168204-solved-invalid-mysql-result-set/#findComment-889018 Share on other sites More sharing options...
ww_mar Posted August 2, 2009 Author Share Posted August 2, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/168204-solved-invalid-mysql-result-set/#findComment-889126 Share on other sites More sharing options...
ww_mar Posted August 2, 2009 Author Share Posted August 2, 2009 Thank you PFMaBiSmAd, thanks to your input I managed to solve the problem, indeed I did not know that sql_query was not a standard function..so I could not use mysql_num_rows. bye bye Quote Link to comment https://forums.phpfreaks.com/topic/168204-solved-invalid-mysql-result-set/#findComment-889142 Share on other sites More sharing options...
PFMaBiSmAd Posted August 2, 2009 Share Posted August 2, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/168204-solved-invalid-mysql-result-set/#findComment-889143 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.