1
$stmtcon = $mysqli->prepare("Select content From tblcontent Where contentid =?");
$stmtcon->bind_param('s', $loadcontent);
$stmtcon->execute();
$stmtcon->bind_result($htmlcontent);
$stmtcon->fetch();
$stmtcon->close();

echo $htmlcontent;

The code works perfectly on my computer, but wont echo on the server I use. If i do an isset on the htmlcontent it comes back as true. Every other element on the page loads.

Is there anything in the settings, security wise that could be blocking this echo? the content contains html.

Thanks.

edit - I changed the type of the field to text from longtext, is there any reason why longtext wouldnt work, thanks for replies already ^_^

5
  • 2
    Make sure it is connecting correctly to the mysql server, and check for mysql errors. Commented May 13, 2012 at 20:47
  • You could do var_dump($htmlcontent)to see exactly what is in $htmlcontent. Commented May 13, 2012 at 20:54
  • Thanks for the suggestions, the variable htmlcontent was holding nothing, I changed the field type from longtext to text and it works now, so for some reason longtext wont work, It's fixed but does anyone know why longtext wouldnt work? Commented May 13, 2012 at 21:07
  • Can it be something related with buffering? Can you put a $stmtcon->store_result() before the bind_result and try? Commented May 13, 2012 at 21:30
  • That fixes it as a longtext anders, nice solution Commented May 13, 2012 at 22:06

1 Answer 1

1

Can it be something related with buffering? Can you put a $stmtcon->store_result() before the bind_result and try?

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

Comments

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.