Hello, I am writing a site, sections are used in the news, in the editor it is necessary to make a choice accordingly to which category the site belongs to.
The question is what to do
<select> <option>Π½ΠΎΠ²ΠΎΡΡΠΈ</option> <option>Π½Π΅ Π½ΠΎΠ²ΠΎΡΡΠΈ</option> <option>ΠΏΡΠΎ Π½ΠΎΠ²ΠΎΡΡΠΈ</option> </select> Data is jerking from the database, including which category the news belongs to. How on html + pkhp to make an item that is received from the database "by default" so that you do not need to set the news category again when editing?
UPD:
Mysql: table news id(autoink) date(datetime) autor(enum=admin,moderator) postPreview(varchar100) post(varchar255) category(enum=newscat1, newscat2, newscat3, no default) <? include(config); mysql_connect(host, log, pass); mysql_select_db(base); q=mysql_query("SELECT * FROM news WHERE id=$_GET[id]") while(FALSE!==(res=mysql_fetch_assoc(q)) { ?> <html> <form method=post> <select> <option>News Cat1</option> <option>News Cat2</option> <option>News Cat3</option> </select> <textarea><? echo $res[postpreview]; ?></textarea> <textarea><? echo $res[post]; ?></textarea> <input type=submit /> </form> If in general, thatβs how it is now.