Philip Posted January 14, 2007 Share Posted January 14, 2007 What does the page sayIt should say something like:[quote]INSERT INTO table1....[/quote]Don't look at the database right now, just the php page and what it outputs. Quote Link to comment https://forums.phpfreaks.com/topic/34097-help-doing-the-simplest-thing/page/2/#findComment-160800 Share on other sites More sharing options...
Barand Posted January 14, 2007 Share Posted January 14, 2007 try odbc_errormsg() instead of odbc_error(). Quote Link to comment https://forums.phpfreaks.com/topic/34097-help-doing-the-simplest-thing/page/2/#findComment-160809 Share on other sites More sharing options...
Bigg Posted January 15, 2007 Author Share Posted January 15, 2007 [quote author=Barand link=topic=122315.msg504861#msg504861 date=1168817531]try odbc_errormsg() instead of odbc_error().[/quote] Still nothing. Get a blank page. Quote Link to comment https://forums.phpfreaks.com/topic/34097-help-doing-the-simplest-thing/page/2/#findComment-160867 Share on other sites More sharing options...
trq Posted January 15, 2007 Share Posted January 15, 2007 Post your current code. Quote Link to comment https://forums.phpfreaks.com/topic/34097-help-doing-the-simplest-thing/page/2/#findComment-160869 Share on other sites More sharing options...
Bigg Posted January 15, 2007 Author Share Posted January 15, 2007 My current code is [code]<?phperror_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] Quote Link to comment https://forums.phpfreaks.com/topic/34097-help-doing-the-simplest-thing/page/2/#findComment-160874 Share on other sites More sharing options...
Philip Posted January 15, 2007 Share Posted January 15, 2007 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!"; } Quote Link to comment https://forums.phpfreaks.com/topic/34097-help-doing-the-simplest-thing/page/2/#findComment-160877 Share on other sites More sharing options...
Bigg Posted January 15, 2007 Author Share Posted January 15, 2007 Says No Colors! Quote Link to comment https://forums.phpfreaks.com/topic/34097-help-doing-the-simplest-thing/page/2/#findComment-160879 Share on other sites More sharing options...
Bigg Posted January 15, 2007 Author Share Posted January 15, 2007 [quote author=Bigg link=topic=122315.msg504931#msg504931 date=1168827139]Says No Colors![/quote]What the Heck? Quote Link to comment https://forums.phpfreaks.com/topic/34097-help-doing-the-simplest-thing/page/2/#findComment-160880 Share on other sites More sharing options...
Bigg Posted January 15, 2007 Author Share Posted January 15, 2007 It works!!!!!!!!! Thanks guys for all your help!!!!!!!! Quote Link to comment https://forums.phpfreaks.com/topic/34097-help-doing-the-simplest-thing/page/2/#findComment-160881 Share on other sites More sharing options...
Philip Posted January 15, 2007 Share Posted January 15, 2007 I'm guessing the problem was within the $_POST data? Quote Link to comment https://forums.phpfreaks.com/topic/34097-help-doing-the-simplest-thing/page/2/#findComment-160882 Share on other sites More sharing options...
Bigg Posted January 15, 2007 Author Share Posted January 15, 2007 [quote author=KingPhilip link=topic=122315.msg504934#msg504934 date=1168827723]I'm guessing the problem was within the $_POST data?[/quote]No the columns in my database where not in the right order. Quote Link to comment https://forums.phpfreaks.com/topic/34097-help-doing-the-simplest-thing/page/2/#findComment-160889 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.