473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

PHP MS-Access odbc_exec() gives 'too few parameters' error

Im failing to update the an MS ACcess. I will appreciate Your advice. I get the error below

Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect in C:\Program Files\Apache Group\Apache2\htdocs\Test\Thomas\HelpDesk\UpdateAs sign.php on line 27

Here is the script that is generating the error.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $conn=odbc_connect("HELPDESK","" ,"");
  4.  
  5.  
  6.      $surname = $_POST['SurNametxt'];
  7.      $firstname = $_POST['firsNametxt'];
  8.      $station = $_POST['Stationtxt'];
  9.      $jobtitle = $_POST['JobTitletxt'];
  10.      $datelogged = $_POST['DateLogtxt'];
  11.      $complaint = $_POST['compl'];
  12.      $status = 'A'; 
  13.      $priority = $_POST['Priortxt'];
  14.      $technician = $_POST['Techtxt'];
  15.      $priority  = "$priority";
  16.  
  17.  
  18. if (!$conn)
  19.        {exit("Connection Failed: " .$conn);}
  20.  
  21. $update = "update hdsk_complain
  22. SET  hd_com_priority = $priority
  23. Where hd_com_jobtitle= 'SDM'";
  24.  
  25.  
  26.  
  27. $result = odbc_exec($conn, $update);
  28.  
  29.  
  30.  
  31. if (!$result) {exit('Execution failed!');} 
  32.  
  33.      odbc_close($conn);
  34. ?>
Aug 22 '07 #1
2 9075
pbmods
5,821 Expert 4TB
Heya, Joe. Welcome to TSDN!

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

Changed thread title to better describe the problem (did you know that threads whose titles contain phrases such as, 'problem' actually get FEWER responses?).
Aug 22 '07 #2
code green
1,726 Expert 1GB
Too few parameters. Expected 1
Using ODBC this usually means you have an incorrect field name.
I am not saying this is a definition of the error.
Just that in my experience this is the problem.
So the problem may be your query
Expand|Select|Wrap|Line Numbers
  1. update hdsk_complain
  2. SET  hd_com_priority = $priority
  3. Where hd_com_jobtitle= 'SDM'";
Aug 24 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
13
by: Jeager | last post by:
Why is it, Microsoft manage to write operating systems and office applications with every bell and whistle facility known to man. Yet, even after years and years of development they still cannot...
10
by: Dirk Vanhaute | last post by:
I have only small knowledge of c++, but I would like to compile the example in http://support.microsoft.com/kb/q246772/ HOWTO: Retrieve and Set the Default Printer in Windows I included "#include...
11
by: Lyle Fairfield | last post by:
The stored procedure script below is an example of how looping, case statements and output parameters can be used in MS-SQL stored procedures to accomplish things for which we may have had to use...
1
by: Yakimo | last post by:
I developed an application in C# using MS Excel objects. The app works fine on the computers with Excel 2000 installed, but gives an error on computers with Excel 2002. I checked an found out that...
3
by: Renato Vieira | last post by:
I get the error 'Procedure 'spBO_HeadlineCreate' expects parameter '@imageid', which was not supplied' when i call the procedure with the @imageid=null, but id the @imageid as a diff. value no...
2
by: jn | last post by:
Hi, I'm passing around 30 arguments to a stored procedure, and I got the following error (see below). It works fine if I narrow down to around 25 args. Is there any workaround to bypass this...
2
by: Viktor Popov | last post by:
Hi, I have trouble with the following: I have this Stored Procedure: IF EXISTS (SELECT name FROM sysobjects WHERE name = 'prUPUSERINFO' AND type = 'P') DROP PROCEDURE prUPUSERINFO GO CREATE...
22
by: M K | last post by:
Heres my SP: ( i am trying to add more than 1 field but get the same error no matter how many i try to add, i thought i would try to insert the primary key only and work up from there but the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.