Jump to content

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


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!"; }
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.