In general, sql records everything except one value (id_band).
if(isset($_POST['save_edit'])){ $age=FormChars($_POST['age']); $band=FormChars($_POST['allband']); $instruments=FormChars($_POST['instruments']); $about=FormChars($_POST['about']); $edit_info=mysql_fetch_array(mysql_query("UPDATE `about` SET `Age` = $age, `id_band` = '$band', `instruments` = '$instruments', `myinfo` = '$about', WHERE `id` ='$qq'")); header("Location: profile.php"); } <form method="post"> <p>Возраст: <?php print $query['Age']; if($edit==true){echo '<input id="inst" type="text" name="age"/>';}?></p> <p>Группа: <?php print $query['band']; if($edit==true){echo '<select id="inst" size="1" name="allband"><option>Выберите группу</option>'; do {printf ('<option value="%s">%s</option>',$data2['id_band'], $data2['Bandname']);} while($data2=mysql_fetch_array($data)); echo '</select>';}?></p> <p>Инструменты: <?php print $query['instruments']; if($edit==true){echo '<input id="inst" type="text" name="instruments"/>';}?></p> <p>О себе: <?php print $query['myinfo']; if($edit==true){echo '<input id="inst" type="text" name="about"/>';}?></p> <?php if($edit==true){echo '<input id="subsub-reg"type="submit" name="save_edit" value="Сохранить"/>';}else{echo' <input id="subsub-reg"type="submit" name="edit" value="Изменить" />';}?> </form>
mysql_query, and go to the library ofmysqliorPDO. Secondly, in the query in the database it is better to use string concatenation: for example, instead ofmysql_query("UPDATEabout` SETAge= $ age WHEREid= 1; ")` usemysql_query("UPDATEabout` SETAge=". $ $. "WHEREid= 1; ")` - intro94$a = 123; echo "qwe$arty";$a = 123; echo "qwe$arty";will not work, because the interpreter will look for the$artyvariable. In this case, you need to writeecho "qwe{$a}rty";Using concatenation, I do not soar my brain when deriving such constructions without spaces, and I can also safely use array values, for exampleecho "qwe".$a['value']."rty";- intro94