Hi all!!!!!! new to the forum and php!!
iam having trouble with this script iam trying to make what iam trying to do it have a 2 forms in 1 document but only display 1 at a time depending on the condition
ive got a form which is used to add to a mysql table and 1 to update i want the add 1 to be visable all the time until the user clicks edit then it gets replaced by a update form
this is the code for the update query would i need to out it in some sort of if statment like if $_Get['editreult'] is clicked echo Update form else echo Add form??? new to php so help with be greatful
<?php
include 'mysql_connect.php';
//Update Match Result
$editid= $_GET['editresult'];
$query="SELECT * FROM war_results WHERE id='$editid'";
$results=mysql_query($query);
$num=mysql_numrows($results);
mysql_close();
$i=0;
while ($i <$num){
$team=mysql_result($results,$i,"team");
$ladder=mysql_result($results,$i,"ladder");
$opp_name=mysql_result($results,$i,"opp_name");
$pub_score=mysql_result($results,$i,"pub_score");
$opp_score=mysql_result($results,$i,"opp_score");
$website=mysql_result($results,$i,"website");
++$i;
echo '<form action="upload.php" method="post">';
echo '<input type="hidden" name="id" value="'.$editid.'>">';
echo "<label><script>DateInput('orderdate', true, 'YYYY-MM-DD')</script>";
echo 'Pub Team <select name="team">';
echo '<option value="'.$team.'">'.$team.'</option>';
echo '<option value="pub^AS">AfterShock</option>';
echo '<option value="pub^SZ">ShotZ</option>';
echo '<option value="pub^Sl.">Slammers</option>';
echo '</select>Ladder';
echo '<select name="ladder" id="ladder">';
echo '<option value="'.$ladder.'">'.$ladder.'</option>';
echo '<option value="edo">ED Open</option>';
echo '<option value="EDE">ED Entry</option>';
echo '<option value="EDF">ED Friendly</option>';
echo '<option value="cb">Clan Base</option>';
echo '<option value="CBF">Clan Base Friendly</option>';
echo '</select></label><label>Opponents Tag';
echo '<input name="opp_name" type="text" id="opp_name" value="'.$opp_name.'" size="10" />';
echo '</label><label>Opponents Website';
echo '<input name="website" type="text" id="website" value="'.$website.'" size="20" />';
echo '<label>PUB Score <input name="pub_score" type="text" id="pub_score" value="'.$pub_score.'" size="3" />';
echo '</label><label>Opponents Score<input name="opp_score" type="text" id="opp_score" value="'.$opp_score.'"size="3" /></label><input type="submit" name="Submit" value="Submit" /></form>';
}
?>
cheers
Jon