喜在那裏工作我已經嘗試了一切,但我不能得到這個工作,我嘗試從MySQL數據庫中的數據加載到窗體,然後當它已被編輯爲它保存了更新查詢PHP的MySQL更新查詢並不
這裏是我的代碼:
<p>Trainer Name: </p>
<td><input type='text' name='TrainerName' value="<?php echo $Row['Trainer_name'] ?>"></td>
<p>Trainer Load URL: <sup>(This is where the trainer is located on the server make sure its in the resources folder)</sup> </p>
<td><input type='text' name='TrainerLoadUrl' value="<?php echo $Row['Trainer_url'] ?>"></td>
<p>Trainer Load Description: <sup>(This is the Txt file for the description)</sup></p>
<td><input type='text' name='TrainerLoadDescription' value="<?php echo $Row['Trainer_url_description'] ?>"></td>
<p>Trainer File Short Name: <sup>(This is the short name for the trainer so the program knows how to handle the request)</sup></p>
<td><input type='text' name='TrainerFileShortName' value="<?php echo $Row['Trainer_url_button_filename'] ?>"></td>
<a id="Save" href=""><button type="submit" name="btn-save" class="btn btn-primary pull-left"><i class="glyphicon glyphicon-save"></i> Save</button></a>
<?php
if(isset($_POST['btn-save'])) {
mysql_connect("localhost", "tsbannoo", "aces111") or die("Connection Failed");
mysql_select_db("tsbannoo_vip")or die("Connection Failed");
$TrainerID = $_GET['id'];
$TrainerName = $_POST['TrainerName'];
$TrainerLoadUrl = $_POST['TrainerLoadUrl'];
$TrainerLoadDescription = $_POST['TrainerLoadDescription'];
$TrainerFileShortName = $_POST['TrainerFileShortName'];
$query = mysql_query("UPDATE Trainers SET Trainer_name = '$TrainerName', Trainer_url = '$TrainerLoadUrl', Trainer_url_description = '$TrainerLoadDescription', Trainer_url_button_filename = '$TrainerFileShortName' WHERE trainer_id = '$TrainerID'");
if(mysql_query($query)){
echo "updated";}
else{
echo "fail";}
}
?>
'$查詢=請求mysql_query(.....如果(的mysql_query($查詢))'是在這裏失敗,'echo'失敗';'沒有幫助你。' –
我該怎麼辦? –
'if($ query){'就夠了 –