Home>

there is a code

<
DIV CLASS= "Admin_DIV" >
    ≪
? php.
        include 'db_doc_2.php';
        $ db= new pdo ("MySQL: Host= $ db_host; dbname= $ db_base", $ db_user, $ db_pass);
        $ db->
Exec ("Set Names UTF8");
        $ db_id= $ _get ['id'];
        $ SQL= "Select $ db_table.id, $ db_table.menu_name, $ db_table_2.id, $ db_table_2.text, $ db_table_2.parent
                    From $ db_table left join $ db_table_2 on $ db_table.id= $ db_table_2.id
                    Where $ db_table.id= $ db_id ";
        $ result= $ db->
Query ($ SQL);
        while ($ row= $ result->
fetch ()) {
    ? ≫
    ≪
div class= "news" >
        ≪
div class= "news_main_block" >
            ≪
div class= "news_title" >
                ≪
P >
≪
? php echo $ row ['menu_name']? >
≪
/P >
            ≪
/div >
            ≪
div class= "news_post" >
                ≪
a href= "doc_update_text.php? id= <
? php echo $ db_id? >
"≫
Change text <
/a >
            ≪
/div >
        ≪
/div >
        ≪
div class= "all_post" >
            ≪
div class= "post_main" >
                ≪
form action= "doc_create_text_conn.php? id= <
? php echo $ db_id? >
"Method="POST ">
                    ≪
INPUT TYPE= "HIDDEN" NAME= "PARENT" VALUE= "<
? php echo $ db_id? >
"≫
                    ≪
Div id= "sample" >
                        ≪
Script Type= "text /javascript" src= "//js.nicedit.com/niceditit.js">
≪
/script >
                        ≪
Script Type= "Text /JavaScript" >
                            bklib.ondomloaded (Function () {niceditors.alltextareas ()});
                        ≪
/script >
                        ≪
Textarea Name= "text" rows= "15" style= "width: 100%; Height: 150px;" Value= "<
? php echo $ row ['text']? >
"≫
≪
/TEXTAREA >
                    ≪
/div >
                    ≪
BR >
                    ≪
Button class= "mail_submit" name= "btn" type= "submit" >
Change content <
/Button >
                ≪
/Form >
            ≪
/div >
        ≪
/div >
    ≪
/div >
    ≪
BR >
≪
? php.
    }
? ≫

To display written text, you need to select ID exactly $ db_table_2, and how to do it xs: D

<
a href= "doc_update_text.php? id= <
? php echo $ db_id? >
"≫
Change text <
/a >

Insert $ db_table_2 table ID

$ db_table_2.id as id2

Ипатьев2021-08-24 05:05:42

and be sure to read about how to properly use the PDA to avoid errors and injections

Ипатьев2021-08-24 05:06:12