Hi i have taken a course online on how to make a login system.
The course is done and i have a compleete source code, i now have tryed to modify the login so that i add a video whith a shuffle button to shuffle through a db contaning video ids but when i include i get error in the form/login ?
The error i get:
Catchable fatal error: Object of class mysqli_result could not be converted to string in C:\xampp\htdocs\ny random video test\Index2.php on line 59
Does anyone have a idea on what is going wrong? both the video and login is using a database?
It’s quite alot of code to post here but has anyone an idea of what might be going on im still a beginner
As @Gandalf says, it’s pretty hard to tell what’s wrong with your code without seeing the code itself.
You might find it helpful to refer to this post, which explains various methods you can use to post your code here, or create a demo. Forum Posting Basics
Are you using prepared statements? It sounds like you are just using ->query or _query. If you have the WHERE clause in your SQL statement, it’s best to use prepared statements as it will lower your chances of being SQL Injected.
Also, are you appending a variable to the mysqli_query or mysqli->query line and then using that variable to check if something exists? This could be the problem, you need to fetch it as a result first and then you can compare it.