Jump to content

Problem with Ranks


Stephan

Recommended Posts

Hi,

I've a problem with inserting of ranks.

If I open the "Pilot Ranks" site in the admin center, I get the following warning and the ranks are not displayed :

Invalid argument supplied for foreach() in ...admin/templates/ranks_allranks.tpl on line 15

When I add a new rank, I get another warning:

Invalid argument supplied for foreach() in ...core/common/RanksData.class.php on line 148

The "added" values are inserted in the sql-database. However, in the admin center, I cannot use the ranks.

What's wrong?

Thanks for your assistance in this case.

Stephan

PS: Version 2.0.822

Link to comment
Share on other sites

debug is now true. i've a log-file.

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261324477))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261324477))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261410877))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261410877))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261497277))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261497277))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261583677))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261583677))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261670077))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261670077))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261756477))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261756477))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261842877))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261842877))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261929277))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261929277))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261324490))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261324490))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261410890))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261410890))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261497290))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261497290))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261583690))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261583690))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261670090))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261670090))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261756490))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261756490))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261842890))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261842890))' at line 2

Caller: DB::write_debug->DB::get_row->PIREPData::getReportCount->PIREPData::ShowReportCounts->Dashboard->pirepcounts->call_user_func_array->MainController::RunAllActions

SELECT COUNT(*) AS count FROM vms_pireps

WHERE DATE(submitdate)=DATE(FROM_UNIXTIME(1261929290))

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(submitdate)=DATE(FROM_UNIXTIME(1261929290))' at line 2

Caller: DB::write_debug->DB::get_results->RanksData::GetAllRanks->PilotRanking->pilotranks->call_user_func_array->MainController::RunAllActions

SELECT r.*, (SELECT COUNT(*) FROM vms_pilots WHERE rank=r.rank) as totalpilots

FROM vms_ranks r

ORDER BY r.minhours ASC

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT COUNT(*) FROM vms_pilots WHERE rank=r.rank) as totalpilo

Caller: DB::write_debug->DB::get_results->RanksData::GetAllRanks->RanksData::CalculatePilotRanks->RanksData::AddRank->PilotRanking->add_rank_post->PilotRanking->pilotranks->call_user_func_array->MainController::RunAllActions

SELECT r.*, (SELECT COUNT(*) FROM vms_pilots WHERE rank=r.rank) as totalpilots

FROM vms_ranks r

ORDER BY r.minhours ASC

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT COUNT(*) FROM vms_pilots WHERE rank=r.rank) as totalpilo

Caller: DB::write_debug->DB::query->LogData::addLog->PilotRanking->add_rank_post->PilotRanking->pilotranks->call_user_func_array->MainController::RunAllActions

INSERT INTO vms_adminlog (`pilotid`, `datestamp`, `message`)

VALUES ('1', NOW(), 'Added the rank "test3"')

Table 'db279538883.vms_adminlog' doesn't exist

Caller: DB::write_debug->DB::get_results->RanksData::GetAllRanks->PilotRanking->pilotranks->call_user_func_array->MainController::RunAllActions

SELECT r.*, (SELECT COUNT(*) FROM vms_pilots WHERE rank=r.rank) as totalpilots

FROM vms_ranks r

ORDER BY r.minhours ASC

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT COUNT(*) FROM vms_pilots WHERE rank=r.rank) as totalpilo

writing permissions for which ordner?

Link to comment
Share on other sites

  • Administrators

Another info, maybe it helps:

The warning/failure was already there after the normal installation of the 1.2.700 version.

Something didn't setup properly with the database then. Can you do a fresh install with a new database? Export your schedules/pireps

Link to comment
Share on other sites

Hi,

I've done a new installation based on the latest beta from http://www.phpvms.net/downloads "Download the latest beta (full install)".

During the install process, some sql errors appear.

Writing "phpvms_test`.`phpvms_adminlog" table... failed - manually run this query:

"CREATE TABLE `phpvms_test`.`phpvms_adminlog` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `pilotid` INT NOT NULL , `datestamp` DATETIME NOT NULL , `message` VARCHAR( 255 ) NOT NULL ) ENGINE = MYISAM ;"

Writing "phpvms_downloads" table... failed - manually run this query:

"CREATE TABLE `phpvms_downloads` ( `id` INT NOT NULL AUTO_INCREMENT, `pid` INT, `name` VARCHAR(50), `description` TEXT ASCII, `link` TEXT ASCII, `image` TEXT ASCII, `hits` INT, PRIMARY KEY (`id`) ) ENGINE = MyISAM;"

Writing "phpvms_fieldvalues_ibfk_1` FOREIGN KEY (`fieldid`) REFERENCES `phpvms_customfields" table... failed - manually run this query:

"ALTER TABLE `phpvms_fieldvalues` ADD CONSTRAINT `phpvms_fieldvalues_ibfk_1` FOREIGN KEY (`fieldid`) REFERENCES `phpvms_customfields` (`fieldid`) ON DELETE CASCADE, ADD CONSTRAINT `phpvms_fieldvalues_ibfk_2` FOREIGN KEY (`pilotid`) REFERENCES `phpvms_pilots` (`pilotid`) ON DELETE CASCADE;"

Writing "phpvms_groupmembers_ibfk_1` FOREIGN KEY (`groupid`) REFERENCES `phpvms_groups" table... failed - manually run this query:

"ALTER TABLE `phpvms_groupmembers` ADD CONSTRAINT `phpvms_groupmembers_ibfk_1` FOREIGN KEY (`groupid`) REFERENCES `phpvms_groups` (`groupid`) ON DELETE CASCADE, ADD CONSTRAINT `phpvms_groupmembers_ibfk_2` FOREIGN KEY (`pilotid`) REFERENCES `phpvms_pilots` (`pilotid`) ON DELETE CASCADE;"

Writing "phpvms_pirepcomments_ibfk_1` FOREIGN KEY (`pirepid`) REFERENCES `phpvms_pireps" table... failed - manually run this query:

"ALTER TABLE `phpvms_pirepcomments` ADD CONSTRAINT `phpvms_pirepcomments_ibfk_1` FOREIGN KEY (`pirepid`) REFERENCES `phpvms_pireps` (`pirepid`) ON DELETE CASCADE ON UPDATE CASCADE;"

I have executed all sql-statements manually. However, according to my opinion, there are some statements in the install.sql file which seem to be wrong.

First warning:

why CREATE TABLE `phpvms_test`.`phpvms_adminlog` ?

Isn't it only CREATE TABLE `phpvms_adminlog`.

Second warning:

I've inserted the table manually. But I don't know why the sql-code does not work automatically.

Third warning:

Sql-Code is ok. However, the key index  for 'fieldid' and 'pilotid' was not defined during creating the table phpvms_fieldvalues. See line 302 in the install.sql-file. I think, there should be the follwing statement:

KEY 'fieldid' ('fieldid'),

KEY 'pilotid' ('pilotid')

Fourth warning:

Analogously to third warning. Index of ‘groupid’ and ‘pilotid’ is missing in the table phpvms_pirepcomments .

Missing lines at line 320 of the install.sql:

KEY ‘groupid’ (‘groupid’),

KEY ‘pilotid’ ('pilotid')

Sixth warning:

Analogously as above. Index of ‘pirepid’ is missing in the table phpvms_groupmembers.

Missing lines at line 320 of the install.sql:

KEY ‘pirepid’ (‘pirepid’)

After the manually amendment of the sql-tables, I have continued the installation process.

Then, on the last page after a click on the button “finish”, the following message appears:

Warning: Invalid argument supplied for foreach() in …core/common/RanksData.class.php on line 144

Warning: Invalid argument supplied for foreach() in …core/common/RanksData.class.php on line 183

Your site is all setup! You can login to the admin panel here

Also, don't forget to register at vaCentral, the best place for VA ranks and news. Join the virtual airline world, and pit your virtual airline against the many others.

The RanksData.class shows at these lines:

Line 114:

$pilots = PilotData::GetAllPilots();

$allranks = self::GetAllRanks();

foreach($pilots as $pilot)

{

Line 183:

$pilotid = intval($pilotid);

$allranks = self::GetAllRanks();

$pilot = PilotData::GetPilotData($pilotid);

foreach($allranks as $rank)

{

After a login in the admin center, the same failure, as mentioned above in this thread, appears at “ Pilot Ranks” and no ranks are shown:

Warning: Invalid argument supplied for foreach() in …admin/templates/ranks_allranks.tpl on line 15

Has someone an idea?

Thanks, Stephan

Link to comment
Share on other sites

  • Administrators

I fixed the adminlog one in the latest beta (836, I hate how the build log is so slow)

The key errors are ok, that's the format phpmyadmin had dumped them out so I'm assuming they're ok.

What MySQL version are you running? And is innodb enabled? Can you do a dump of structure from phpmyadmin and attach it to your post?

EDit: I just checked, the install.sql didn't update. grr. But the other errors you're getting are strange.

Link to comment
Share on other sites

EDit: I just checked, the install.sql didn't update. grr.

No problem  ;)

Now I've done a new install of the 700, then an update to 828. The MySQL database has the version 5.0.

The installation was without errors and it works all right now. But I don't know why. The first installation was equal to the last one. I monitor the further proceeding.

Thanks all for their time and help!

Regards, Stephan

Link to comment
Share on other sites

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.

Loading...
×
×
  • Create New...