Query sqlite from web form?

Hi, i found this code. i need query a database sqlite.db, and return result into a web. that code and error:

#[macro_use] extern crate rocket;
use rocket::response::content::Html;
use rusqlite::Connection;

#[post("/search", data = "<form_name>")]

fn searching_name(form_name: rocket::form::Form<String>) -> Html<String> {
    let conn = Connection::open("database.db").unwrap();
    let search_name = form_name.into_inner();
    let mut stmt = conn.prepare("SELECT * FROM movies WHERE title = ?").unwrap();
    let mut rows = stmt.query(&[&search_name]).unwrap();
    let mut result = String::from("<h1>Results</h1>");

    while let Some(row) = rows.next().unwrap() {
        let name: String = row.get(0).unwrap();
        // include other camps if neccesary
        result.push_str(&format!("Name found: {}\n", name));
        Html(result)
    }
}

#[launch]
fn rocket() -> _ {
    rocket::build().mount("/", routes![searching_name])
}

ERROR:
error[E0432]: unresolved import rocket::response::content::Html
--> src/main.rs:2:5
|
2 | use rocket::response::content::Html;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no Html in response::content

NOTES Cargo contain:
[dependencies]
rocket = "0.5.0"
rusqlite = "0.31.0"

thanks for attention.

same error in this code:

#[macro_use] extern crate rocket;

use rocket::request::Form;
use rocket::response::content::Html; // Corrected import statement
use rusqlite::Connection;

#[derive(FromForm)]
struct SearchForm {
    title: String,
}

#[get("/")]
fn index() -> Html<&'static str> {
    Html(r#"
        <form action="/search" method="post">
            <input type="text" name="title" placeholder="Enter title">
            <button type="submit">Search</button>
        </form>
    "#)
}

#[post("/search", data = "<form>")]
fn search(form: Form<SearchForm>) -> Html<String> {
    let conn = Connection::open("mydatabase.db").expect("Failed to open database");

    let search_title = form.into_inner().title;

    let mut stmt = conn.prepare("SELECT * FROM my_table WHERE title = ?").expect("Failed to prepare query");
    let mut rows = stmt.query(&[&search_title]).expect("Failed to execute query");

    let mut result = String::new();
    while let Some(row) = rows.next().expect("Failed to get next row") {
        let title: String = row.get(0).expect("Failed to get title");
        result.push_str(&format!("Title found: {}\n", title));
    }

    Html(result)
}

#[launch]
fn rocket() -> _ {
    rocket::build().mount("/", routes![index, search])
}

39 | use rocket::response::content::Html;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no Html in response::content

NOTE: In Rocket version 0.5.0, the Html type is not directly available in rocket::response::content

Yes, that is what the error message means.

It seems that it's called RawHtml now.

I everyone, I continue with this error in this code:
error[E0412]: cannot find type Html in module content
--> src/main.rs:7:44
|
7 | fn search_title(title: String) -> content::Html {
| ^^^^ not found in content

#[macro_use] extern crate rocket;

use rocket::response::content;
use rusqlite::Connection;

#[post("/search", data = "<title>")]
fn search_title(title: String) -> content::Html<String> {
    let conn = Connection::open("books.db").unwrap();

    let mut stmt = conn.prepare("SELECT title FROM movies WHERE title LIKE ?").unwrap();
    let rows = stmt.query_map([title], |row| {
        let title: String = row.get(1)?;
        Ok(title)
    }).unwrap();

    let mut results = String::new();
    for title in rows {
        results.push_str(&format!("Title: {}\n", title.unwrap()));
    }

    content::Html(results)
}

#[get("/")]
fn index() -> &'static str {
    include_str!("index.html")
}

#[launch]
fn rocket() -> _ {
    rocket::build().mount("/", routes![index, search_title])
}


please help

It appears you've found some rocket 0.4 (or possibly older?) code and will need to upgrade it to rocket 0.5

See Upgrading - Rocket Web Framework