quick question i have pages that rename and delete they all work ok u call from the dropdown box and u can rename the (?)
that all works fine but i have to refresh the page before the new name shows is there a way to refresh results once u click rename
? Not important just wanted to make site a little better
heres the code
CODE
<?php require_once('../Connections/stablemaster.php');
session_start();
mysql_select_db($database_stablemaster, $stablemaster);
$stable_nameQ = mysql_query("SELECT stable_name FROM users WHERE id='".$_SESSION['uid']."'");
$stable_nameA = mysql_fetch_assoc($stable_nameQ);
$query_Recordset1 = "SELECT horse_stats.name_id FROM horse_stats WHERE `stable_name` = '".$stable_nameA['stable_name']."';";
$Recordset1 = mysql_query($query_Recordset1, $stablemaster) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$id = $_POST['horse'];$newname = $_POST['buy_horse_name'];$str = "UPDATE horse_stats SET name_id='$newname' WHERE name_id='$id'";mysql_query($str)or die(mysql_error());
?>
<style type="text/css">
<!--
body {
background-color: #BFEBFF;
}
-->
</style><form action="<?php echo $_SERVER['PHP_SELF'];?>"
method="post" name="form1" id="form1">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="39%"><div align="center">
<h4>Select Horse</h4>
</div></td>
<td width="61%"><select name="horse" id="horse">
<option value="" <?php if (!(strcmp("", $row_Recordset1['name_id']))) {echo "selected=\"selected\"";} ?>>select horse</option>
<?php
do {
?>
<option value="<?php echo $row_Recordset1['name_id']?>"<?php if (!(strcmp($row_Recordset1['name_id'], $row_Recordset1['name_id']))) {echo "selected=\"selected\"";} ?>><?php echo $row_Recordset1['name_id']?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
</select></td>
</tr>
<tr>
<td><div align="center">
<h4>Type in NewName Here </h4>
</div></td>
<td><input name="buy_horse_name" type="text" size="30" maxlength="25" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="rename Horse" id="rename Horse" value="rename " /></td>
</tr>
</table>
</form>
<p> </p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
This post has been edited by peter yianni: 2 Jul, 2009 - 07:37 PM