Mysql error expects parameter 1 to be resource string

Finally, for future reference, if your query doesn' t work, print the error and the SQL query used ( something like what' s on Col Shrapnel' s answer). The problem is that mysql_ query( ) is returning a boolean instead of a result resource. The reason it failed is because you have escaped the back ticks in the PHP string where you did not need to. Your lines look like this:. Don' t write new code that uses the mysql_ * functions. It is much better to check the errors explicitly after every function call. You have two errors in the same line of code: 1) You are mixing mysql and mysqli API which you cannot do. 2) You are passing the query to your function instead of the result resource: while( $ riga = mysql_ fetch_ array( $ sel) ) {. Since it looks like it' s being done procedurally try changing your mysql stuff which has been deprecated to mysqli. It' s likely you.

  • Error 5858 wmi activity
  • Gta 4 ошибка directx
  • Mysql error pid
  • Xml parse error net
  • Cara mengatasi error windows media player


  • Video:String resource expects

    Mysql error expects

    mysql_ query returns FALSE if the query had an error, in your case, where you are using it for a SELECT type query. Parameter 1: Database connection Variable which contains you database table, username and password info. Warning: mysql_ fetch_ array( ) expects parameter 1 to be resource, string given HELPPP. You' re trying to give it a string. You' re missing a step. You' ll have to execute that query first:. You' d be mising mysqli and mysql calls, which is not supported. They' re completely independent of each other internally, and a db. mysql_ error( ) expects parameter 1 to be resource, string given. Everything works fine, but it shows these errors. The error handler is supposed to print the " surrounding code" for all mysql related warnings/ errors and the ( raw) output should. your mysql connect should be like that mysql_ connect( ' localhost', ' root', ' mysql_ password' ) ; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ you forgot this. you forgot password. and you should not use mysql but instead use PDO or MYSQLI. mysql_ fetch_ array( ) expects parameter 1 to be resource, string given [ duplicate] · php mysql oop.

    You are passing in $ query which is your sql string, when you need to pass in $ result which is your db result object. class DBQueries extends. Your sql queries should be: mysqli_ query( " INSERT INTO Persons ( FirstName, LastName, Age) VALUES ( ' Naruto', ' Uzumaki', 18) ", $ dbhandle) ; mysqli_ query( " INSERT INTO Persons ( FirstName, LastName, Age) VALUES. The error handler is supposed to print the " surrounding code" for all mysql related warnings/ errors and the ( raw) output should look like < fieldset> < legend> mysql_ fetch_ assoc( ) expects parameter 1 to be resource, string given.