Witam mam problem próbuję id wybranego charname wyświetlić w formularzu aby potem te id dodać do bazy danych
id próbuje wyświetlić za pomocą tego
<?php echo $charname[1
]=$characterID[1] ?>
lecz to wyświetla id innego charname patrzałem za pomocą $_POST ale też nie wyświetla
<?php if ($_POST['buy']==false): ?>
<?php
$id=$_SESSION['username'];
$query ="SELECT * FROM accounts,characters WHERE accounts.accountID=characters.ownerID AND username='$id'";
// Print out the contents of each row into a table
echo "<select size=1 name=char_receiver>"; $charname[1] = $row['charname'];
$characterID[1] = $row['CharacterID'];
echo '<option>'.$charname[1].'</option>'; }
?>
<form method='POST' action='2.php'>
<table cellspacing="10">
<tr>
<td>ID</td><td>Stack ID</td><td>Nazwa</td><td>Cena</td><td></td>
</tr>
<tr>
<td>
<?php echo $_POST['itemid']?><input type="hidden" name="item1" value="
<?php echo $_POST['itemid']?>"/></td>
<td>
<?php echo $_POST['itemstack_id']?><input type="hidden" name="stack1" value="
<?php echo $_POST['itemstack_id']?>"/></td>
<td>
<?php echo $_POST['name']?><input type="hidden" value="
<?php echo $name ?>"/></td>
<td>
<?php echo $_POST['cost']?><input type="hidden" value="
<?php echo $cost ?>"/></td>
<td><input type="hidden" name="char_receiver" value="
<?php echo $charname[1
]=$characterID[1] ?>"/></td>
<td><input type='submit' name="buy" value='Kup'></td>
</tr>
</table>
</form>
<?php endif; ?>
Ten post edytował pajurpl 1.10.2014, 19:54:59