0

I recently bought a Quiz script but I was not able to install it. For LocalHost and for website Im getting the same error:

SQLSTATE[42000]: Syntax error or access violation: 1064 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 ')' at line 1 (SQL: select * from user_quiz_group where status = ? and group_id in ()) (Bindings: array ( 0 => 1, ))

protected function handleQueryException(\Exception $e, $query, $bindings)
{
    $bindings = var_export($bindings, true);

    $message = $e->getMessage()." (SQL: {$query}) (Bindings: {$bindings})";

    throw new \Exception($message, 0, $e);
}

It is the first time when I'm dealing with Laravel framework, so unable to understand its functionality completely. AT first look, I can't find an error but, if you check this image there are hundreds of error on

https://s9.postimg.org/rwk5p7a4f/errors1101.jpg

a single file called Connection.php which I uploaded to

https://gist.github.com/anonymous/becc0a8f614d405e5eb6299d18383f24

The script came with its own .SQL file, I uploaded it without error, I configured the database, but I cant solve this error myself, and the developer which I contacted through Code Canyon and email, has never replied. A help would be amazing as I have already spent 6 hours dealing with it and understanding whats wrong with the code.

2 Answers 2

1

The problem in syntax of that query select * from user_quiz_group where status = ? and group_id in () , IN must contain value (or values separated by comma).

In exception trace look at first "position".

Sign up to request clarification or add additional context in comments.

1 Comment

I have made deep search in files through NotePad ++ and was not able to find Select calls for user_quiz_groups. It seems I will have to ask for a refund as the help is not coming from the developer :( Thanks for your answer and help!
1

The problem in syntax of that query select * from user_quiz_group where status = ? and group_id in () , IN must contain value (or values separated by comma).

In exception trace look at first "position".

basically the $bindings variable should contain something like this

$bindings =array('status' => 1,'position'=>array(1,2,3,4))

5 Comments

I have never faced such issue before. The instruction says: MCrypt PHP Extension maybe this is my problem and need to install this one?
yeah you need to install it, but that doesnt relate to the problem you are facing, this is query related issue and can you post where you are passing the query and bindings? where you are calling this function
According to the error message the error comes from the file Connection.php which I placed above, but the SQL calls are located on this file: sandbox.onlinephpfunctions.com/code/… Thank you BTW :)
public function getActiveQuizGroup() { $group_ids = array(); $group_id = $this->getActiveScheduleGroup(); foreach ($group_id as $gp) { $group_ids[] = $gp->group_id; } return DB::table('user_quiz_group')->where('status', 1)->whereIn('group_id', $group_ids)->get(); } this is the function, try to print $group_ids and check what it is returning
Unable to print: Fatal error: Class 'Eloquent' not found in C:/xampp/htdocs/fbquiz/app/models/Quiz.php on line 14 Well, I think I'm wasting your time and best way would be to return this script as I didn't get a official support which I had the right to request. Thank you very much! I thought it would be easy to solve but after each piece, there are more errors following.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.