'm getting a parser error on the following sql insert statement in my php
script. A form where most of these values are entered submits the values to
the php program. In the program, fter I connect/open the db I have this insert
query. I've tried variations of this insert statement and am still getting the
error. Can anyone make any suggestions as to what might be the problem?
$sqlinsert = "insert into table1
(firstname,lastname,address,phone,fax,email,idandname)
values
('$firstname','$lastname','$address','$phone','$fax', '$email', null);
(previous typo fixed - that was only an input error here into the php builder email)
in the underlying table1, there is another field, an autoincremented key, that
I have left completely out of this insert statement. (I have included it in
other statements to try other options, with a value of null for it, but that
isn't helping either.) Also the value for the idandname field is created
later; it isn't entered via the form.
Once the form submits it's entered values to the php script that contains the
above code I'm getting a parse error within this SQL statement.
HTML code follows
<td align="right">
first name: </td>
<td>
<input type="text" name="firstname" size="50" maxlength="50">
</td></tr>
<tr> <td align="right"> last
name: </td>
<td>
<input type="text" name="lastname" size="50" maxlength="50">
</td>
</tr>
<tr>
<td align="right">
address: </td>
<td>
<input type="text" name="address" size="50" maxlength="50">
</td>
</tr>
<tr>
<td align="right">
phone: </td>
<td>
<input type="text" name="phone" size="50" maxlength="50">
</td>
</tr>
<tr>
<td align="right">fax: </td>
<td align="left">
<input type="text" name="fax" size="50" maxlength="50">
</td>
</tr>
<tr>
<td align="right">
E-mail: </td>
<td align="left">
<input type="text" name="email" size="50" maxlength="50">
</td>
</tr>
etc.