0

I have the following code:

<?php
    $mysqli = new MySQLi($db_host, $db_user, $db_pass, $db_select);
    $stmt = $mysqli->prepare("SELECT new_title, new_subtitle, new_description FROM news WHERE new_id = ?");
    $stmt->bind_param("i", $selected_id);
    $stmt->execute();
    $stmt->bind_result($news_title, $news_subtitle, $news_description);
    $stmt->fetch();
    $stmt->free_result();
    $stmt->close();
    $mysqli->close();
?>
<?php echo $news_title; ?><br />
<?php echo $news_subtitle; ?><br />
<?php echo $news_description; ?>

The problem is that $news_description comes back empty although there is a value in the db! Please note that I encountered that problem before (with a different table and fields) but I did not try to solve it because I changed my plans regarding that page. Now unfortunately, I must solve it and I have been at for 3 days now and still no go!

0

1 Answer 1

0

ok, I changed the data type of news_description, in the db, from longtext to varchar(255) and it worked!

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.