Solved: 10 Years, 2 Months, 1 Week ago Registration using SQLite fails
#1
Solved: 10 Years, 2 Months, 1 Week ago
When trying to register, I get the following error after clicking on the "I Agree" button:

SQL Error: -
Query: SQLSTATE[HY000]: General error: 1 no such function: RAND

SQLite version is 3.7.7.1

Rick
Reply
#2
Solved: 10 Years, 2 Months, 1 Week ago
It will be fixed in MyBB 1.8.1, in meanwhile you can apply the changes from here: https://github.com/mybb/mybb/commit/5ece...cb4e0feabd

Also, make sure the conditional is actually:
if($db->type == 'pgsql' || $db->type == 'sqlite')
as per ArouG's comment.
Reply
#3
Solved: 10 Years, 2 Months, 1 Week ago
Hello !!

Sorry Destroy666 ... just a little clarification :

1 - my topic, on this forum, is here : http://community.mybb.com/thread-159906.html
2 - and my fix is in the topic : update the inc/functions_user.php

You talk about a version (1.8.1 ?? not here) and about a futur patch not here too Wink

the fastest solution is to make the changes as :

********before :
function generate_question()
{
global $db;

$query = $db->query("
SELECT qid, shown
FROM ".TABLE_PREFIX."questions
WHERE active='1'
ORDER BY RAN()
LIMIT 1
");

********after :
function generate_question()
{
global $db;

$query = $db->query("
SELECT qid, shown
FROM ".TABLE_PREFIX."questions
WHERE active='1'
ORDER BY RANDOM() <---- (RAND becomes RANDOM)
LIMIT 1
");


2 characteres to be added : 'OM'
Reply
#4
Solved: 10 Years, 2 Months, 1 Week ago
Ummm? As I said, he needs to apply the fix mentioned by me manually, of course, and it's better than just adding 'OM' if the OP decides to switch to MySQL someday.
Reply
#5
Solved: 10 Years, 2 Months, 1 Week ago
Thanks for the quick fix! Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)