Результаты поиска Php не присваиваются значениям
я хочу выполнить поиск из таблицы базы данных и отобразить его в HTMl форме, но эти значения не присваиваются объявленным переменным php
Что я уже пробовал:
<?php if(isset($_POST['search'])) { $connect= mysqli_connect("localhost","root","1234","latgsjason"); if (mysqli_connect_error()){ echo"Failed to Connect"; } // $result=mysqli_query($connect,"SELECT * FROM customer WHERE veh_regno='$_POST[V_Regno]'"); $Vregno = $_POST['V_Regno']; $query="SELECT 'nic','fullname','address','contact','color' FROM customer WHERE 'veh_regno'=$Vregno LIMIT 1"; $result=mysqli_query($connect,$query); while ($row=mysqli_fetch_array($result)) { $VReg=$row['veh_regno']; $Nic=$row['nic']; $FName=$row['fullname']; $Address=$row['address']; $Contact=$row['contact']; $Color=$row['color']; } mysqli_free_result($result); mysqli_close($connect); } else { $VReg=""; $Nic=""; $FName=""; $Address=""; $Contact=""; $Color=""; } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Manage Account</title> <link rel="stylesheet" type="text/css" href="CSS/Style SheetGeneral.css"> </head> <body> <br><br><br> <table background="Images/Back Ground Images/BG1.jpg" border="2" align="center" width ="825" height="820"> <th align=center valign=center> <form action="ManageAccount.php" method="POST"/> <div class="textcenter1"> <h2>Manage An Account</h2> </div> <br><br> <table border="0"; align="center" width ="655" height="550" > <tr> <td> VEHICLE REGISTRATION NUMBER : </td> <td> <input type="text" name="V_Regno" size="40" value="<?php echo $VReg; ?>"> </td> </tr> <tr> <td> NATIONAL ID : </td> <td> <input type="text" name="Nic" size="40" value="<?php echo $Nic; ?>"> </td> </tr> <tr> <td> FULL NAME : </td> <td> <input type="text" name="F_Name" size="40" value="<?php echo $FName; ?>"> </td> </tr> <tr> <td> ADDRESS : </td> <td> <input type="text" name="Address" size="40" value="<?php echo $Address; ?>"> </td> </tr> <tr> <td> TELEPHONE NUMBER/MOBILE NUMBER : </td> <td> <input type="text" name="Contact" size="40" value="<?php echo $Contact; ?>"> </td> </tr> <tr> <td> COLOR : </td> <td> <input type="text" name="Color" size="40" value="<?php echo $Color; ?>"> </td> </tr> <tr> <td> NIC Attachment :<select name="NicChk"> <option selected="" value="">(New Document?)</option> <option value="yes">YES</option> <option value="no">NO</option> </select> </td> <td> <input type="file" name="Nic_Img" accept="image/*"> </td> </tr> <tr> <td> Registration Certificate : <select name="RCcheck"> <option selected="" value="">(New Document?)</option> <option value="yes">YES</option> <option value="no">NO</option> </select> </td> <td> <input type="file" name="Reg_Cer" accept="image/*"> </td> </tr> <tr> <td></td> <td> <input align="left" type="image" src="Images/Buttons/button_search.png" alt="button" name="search" value="Search" width="110" height="50"/> </form> <!--if submit button and reset button in same <form> will perform the formvalidation which leads the reset button also work as a submit button(wont reset anything)--> <form action="UpdateAccount.php" method="POST"/> <input align="center" type="image" src="Images/Buttons/button_update.png" alt="" name="reset" value="reset" width="110" height="50"/> </td> </tr> </form> </table> </th> </table> <br><br> </body> </html>