Parse Error on SQL Insert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm working on an insert record page with a multiple file upload script of
which I understand the fundamentals.
However, on submission I am getting the following error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in
C:\apache2triad\htdocs\damotors\admin\insertnew.php on line 34

Where line 34 is...

$insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,
image2, image3, forsale) VALUES ($_POST['model'], $_POST['year'],
$_POST['details'], $_POST['price'], $_FILE['image']['name'][0],
$_FILE['image']['name'][1], $_FILE['image']['name'][2], $_POST['forsale'])";


For info, the HTML for the form is as follows:

    <tr valign="baseline">
      <td nowrap align="right">Image1:</td>
      <td><input type="file" name="image[]"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Image2:</td>
      <td><input type="file" name="image[]"></td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">Image3:</td>
      <td><input type="file" name="image[]"></td>
    </tr>

I've been slaving away for an hour and it's probably something really
obvious but I'd really appreciate it if someone could point it out to me
please?
Previously I was getting an "image1 cannot be null" error which I couldn't
work out either. That's gone, but I still can't work out what's going on.

Many thanks,

Tom



--
Tom Chubb
tom@xxxxxxxxxxxxxx
07915 053312

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux