Hello,
I’m trying to create a form that allows users to add things to the database. Everything is working fine except for one of the input fields, which is causing me trouble. Whenever I edit out $manuf, the rest of the information is added in fine. However, if I try to keep it in I get “Query failed”. I’m completely stumped!
The PHP:
[code=php]
$awpn = $_POST[‘awpn’];
$users = $_POST[‘users’];
$link = $_POST[‘link’];
$manuf = $_POST[‘manuf’];
$qry = “INSERT INTO names(id, AllWorld, Cross) VALUES(‘$users’, ‘<a href=”$link”>$awpn</a>’, ‘$manuf’)”;
$result = @mysql_query($qry);
if($result) {
header(“location: cross-success.php”);
exit();
}else {
die(“Query failed”);
}
The HTML:
[code=html]<form id=”crossform” name=”crossform” method=”post” action=”cross-exec.php”>
<table width=”500″ border=”0″ cellspacing=”3″ cellpadding=”5″>
<tr>
<td width=”104″>Series:</td>
<td width=”367″>
<input type=”text” name=”awpn” id=”awpn” /></td>
</tr>
<tr>
<td>Manuf. Series:</td>
<td><input name=”manuf” id=”manuf” type=”text” /></td>
</tr>
<tr>
<td>Manuf:</td>
<td><select name=”users”>
<option value=”” selected=”selected”>Select a manufacturer:</option>
<option value=”1″>XXXX</option>
<option value=”2″>XXXY</option>
<option value=”3″>XXYY</option>
</select></td></tr>
<tr>
<td>Link to datasheet:</td>
<td><input name=”link” type=”text” id=”link” size=”50″ value=”http://….” /></td>
</tr>
<tr align=”center” valign=”middle”>
<td colspan=”2″>
<input type=”submit” name=”Submit2″ value=”Cross” />
Thanks for any help!