Mysqli_fetch_assoc expects parameter 1 to be mysqli_result
Sign in Email.
I'd move the actual fetch into the class so you wrap the nature of the db more completely Reply to author. Copy link. Report message. Show original message. Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message.
Mysqli_fetch_assoc expects parameter 1 to be mysqli_result
The script is basically trying to do a few simple things by connecting to a database and reading off a record, and then getting the results from an array. Once you have it working, you need to use prepared statements instead of just appending strings into your query. Thanks for the reply. The readdb function now looks like this, and at least produces a result:. Thank you for the post; appreciated. For prepared statements, scroll down a bit and browse some threads - there are plenty of examples on here, some in the last few days. But I always have to look up mysqli syntax. Some of my issue had to do with the fact that because I default the ID of the record to 1, when I later try to read the prior record there is none. Also, I have now set the default value of ID as an integer, rather than a string. Update: Ah, figured it out. Thanks for both replies.
Posted May pm Richard MacCutchan. Treat my content as plain text, not as HTML.
.
Doing an assignment for uni, and stuck on an error. Ill attach some files to show the problem and any help very much appreciated. YOu posted an awful lot of c The problem is on LINE Look at it and then figure out why your db connection or your query is failing you.
Mysqli_fetch_assoc expects parameter 1 to be mysqli_result
Sign in Email. Forgot your password? Ask a Question. Please Sign up or sign in to vote. See more: SQL. Posted May pm Matas - developer. Add a Solution. You could start by clicking on the numerous links at the right side of this page which relate to this issue :. Richard MacCutchan May am.
Red dead redemption 2 missable items
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message. Permalink Share this answer. I do not think that is what you want. Reply to author. I think I'm going to be a rich man If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. OK Paste as. If anyone can help i would really appreciate it This email is in use. Richard MacCutchan May am. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. I'd move the actual fetch into the class so you wrap the nature of the db more completely Paste as-is. Richard MacCutchan.
Fetches one row of data from the result set and returns it as an associative array. Each subsequent call to this function will return the next row within the result set, or null if there are no more rows.
Permalink Share this answer. Hopefully I wont encounter the same problem again. Thanks for both replies. Richard MacCutchan May am. If anyone can help i would really appreciate it Salvatore Terress. I wrote that class while studying and havent really revised it since Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message. I do not think that is what you want. This email is in use. Yes, can confirm that my code works okay without the semi-colon in the query. The script is basically trying to do a few simple things by connecting to a database and reading off a record, and then getting the results from an array. For prepared statements, scroll down a bit and browse some threads - there are plenty of examples on here, some in the last few days. Thank you for the post; appreciated.
Just that is necessary. Together we can come to a right answer. I am assured.