mysqli - Cannot pass parameter by reference PHP prepared statement problem -


i trying make query prepared statement retrieve information , make query information received first query, receiving error:

cannot pass parameter reference 

is there way around this?

this code:

$dbh = getdbh(); $stmt = $dbh->prepare("select small info user = ?"); $stmt->bind_param("s",$userid); $stmt->execute(); $stmt->bind_result($small); $stmt->fetch(); $stmt->close(); $stmt = $dbh->prepare("insert method(small) values(?)"); $stmt->bind_param("s",$small); $stmt->execute(); $stmt->close(); 

i think may have got work adding

return $small; 

after

$stmt->fetch(); 

although have not had time test actual values, not recieving errors, unsure if code stops @

return $small; 

or if continues execute, may able rewrite function , return value.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -