Jump to content

Help doing the simplest thing!!!!!!!!!!!!!


Bigg

Recommended Posts

My current code is [code]<?php
error_reporting(E_ALL);
ini_set("display_errors","1");
if (isset($_POST['Color1']) && isset($_POST['Color2'])) {
  $Color1 = $_POST['Color1'];
  $Color2 = $_POST['Color2'];
  $conn = odbc_connect('Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\Program Files\Abyss Web Server\htdocs\p\php imput box\mydb.mdb','','');
  $sql = "INSERT INTO Table1 (Color1, Color2) VALUES ('$Color1', '$Color2')";
echo $sql;
  if (odbc_exec($conn,$sql)) {
    echo "insert success";
  } else {
    echo "insert failed<br />";
    echo odbc_errormsg()."<br />";
    echo $sql;
  }
odbc_close($conn);
}
?>[/code]
It doesn't show anything at all?

Not even something like INSERT INTO... ?

What about you post values, are you sure those are the correct names? Because if one is missing then it won't run the code.

Try changing
odbc_close($conn);
}
to this:
odbc_close($conn);
} else { echo "No colors!"; }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.