hi,
i have the following: -
<form method="post" action="<?php echo $PHP_SELF;?>">
-
<span style='color: #008b8b; font-size: 10pt; font-family: arial'>
-
    <b>search </b><input type="number" size="24" class = "INPUTWHITE" maxlength="20" name="SEARCH" value="<?php echo $_POST['search'];?>"
-
</span>
-
<input type="submit" value=">" name="submit" class = "btn"></form>
-
-
-
$SEARCH = $_POST["SEARCH"];
-
-
$sql="SELECT [account number] AS acct, month, code, age, [time] AS TM FROM table_name WHERE GRP = '".$GRP."' AND acct= '".$SEARCH."' AND day ='".$count."'";
-
I have checked the table to make sure the [account number] is a number type. i am getting an error message like:
"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 Software ..."
not sure what to do...
thanks in advance,
geebee
5 1108
Can we see the part that uses odbc_exec() please.
hi,
here is the whole thing... -
<html>
-
-
-
<STYLE type="text/css">
-
TD{font-family:ARIAL;font-size:12px;color:#666666;}
-
BODY{font-family:ARIAL;font-size:11px;color:#666666;background-color:#ffffff;margin-top:40px;margin-bottom:0px;margin-left:40px;margin-right:0px;}
-
FORM{display:inline;}
-
A:LINK, A:VISITED{color:#6699cc;text-decoration:none;}
-
A:HOVER{text-decoration:underline;color:#CCCCCC;}
-
.HOMETEXT{font-size:14px;}
-
.ITEMNAME{font-size:14px;font-weight:BOLD;}
-
/*.WHITELINK{color:#ffffff;font-size:10px;}*/
-
.INPUT{border-color:#66CCFF;border-width:1px;border-style:solid;background-color:#eeeeee;font-size:10px;}
-
.INPUTWHITE{border-color:#66CCFF;border-width:1px;border-style:solid;background-color:#ffffff;font-size:10px;}
-
.INPUT2{background-image:url(webtd_grass_matrix_pic4.jpg);color:#666666;border-top:1px solid #BBBBBB;border-bottom:1px solid #BBBBBB;border-right:1px solid #BBBBBB; border-left:1px solid #BBBBBB; font-family:copperplate gothic light;font-size:7pt;}
-
.BUTTON{border-color:#99CCFF;border-width:1px;border-style:solid;}
-
.BOLD{color:#666666;font-family:Arial, Tahoma, Helvetica, sans-serif;font-size:8pt;font-weight:BOLD;}
-
.BOLDLARGE{color:#666666;font-size:12pt;font-weight:BOLD;}
-
.CURRENTPAGE{color:#666666;font-size:8pt;font-weight:BOLD;}
-
.ERROR{color:#cc0033;font-size:8pt;font-weight:BOLD;}
-
.MENUCELL{height:24px;width:80px;text-align:center;font-weight:BOLD;color:#FFFFFF;border-top:1px solid #BBBBBB;border-bottom:1px solid #BBBBBB;border-right:1px solid #BBBBBB;}
-
.MENUCELLSTART{height:24px;width:80px;border:1px solid #BBBBBB;text-align:center;font-weight:BOLD;color:#FFFFFF;}
-
.SPACE1{padding-left:20px;}
-
.BORDER{background-color:#EEEEEE;color:#666666;border-top:1px solid #BBBBBB;border-left:1px solid #BBBBBB;border-bottom:1px solid #BBBBBB;border-right:1px solid #BBBBBB;height:24px;padding-left:16px;}
-
.IVORYBG{background-color:#FFFFF0;color:#EEE8AA;border-top:1px solid #EEE8AA;border-left:1px solid #EEE8AA;border-bottom:1px solid #EEE8AA;border-right:1px solid #EEE8AA;height:24px;padding-left:16px;}
-
.BORDER1{border-bottom:1px solid #BBBBBB;}
-
.BORDER2{background-color:#EEEEEE;color:#666666;border:1px solid #BBBBBB;}
-
.BORDER3{background-color:#000000;color:#666666;border-top:1px solid #ffffff;border-bottom:1px solid #ffffff;border-right:1px solid #ffffff;height:44px;padding-left:16px;}
-
.HEADER{background-color:#EEEEEE;color:#666666;border:1px solid #BBBBBB;height:24px;font-weight:BOLD;padding-left:20px;}
-
.PRODCELL{border-left:1px solid #BBBBBB;border-bottom:1px solid #BBBBBB;background-color:#FFFFFF;}
-
.HEADER1{background-color:#EEEEEE;color:#666666;border-left:1px solid #BBBBBB;border-top:1px solid #BBBBBB;border-bottom:1px solid #BBBBBB;height:24px;font-weight:BOLD;padding-left:20px;}
-
.HEADER5{width:130px;color:#666666;background-color:#EEEEEE;border-top:1px solid #BBBBBB;border-right:1px solid #BBBBBB;height:24px;}
-
.PRODIMGLGCELL{width:300px;height:295px;background-color:#EEEEEE;border-left:1px solid #BBBBBB;border-right:1px solid #BBBBBB;border-bottom:1px solid #BBBBBB;vertical-align:top;text-align:center;}
-
.PRODIMGSMCELL{width:130px;height:125px;background-color:#EEEEEE;border-left:1px solid #BBBBBB;border-right:1px solid #BBBBBB;border-bottom:1px solid #BBBBBB;vertical-align:top;text-align:center;}
-
.PRODIMGSM{border:1px solid white;height:120px;width:120px;align:middle;}
-
.PRODIMGLG{border:1px solid #BBBBBB;height:290px;width:290px;align:middle;}
-
.CATIMG{width:120px;height:120px;border:1px solid #BBBBBB;}
-
.stylegreyblue {color: #669999}
-
.stylelightblue {color: ##DEE7F7}
-
.styleblack {color:#000000}
-
.stylegreyblack {color:#444444}
-
.styledarkpink {color: #990033}
-
.styleslateblue {color: #008b8b}
-
.stylewhite {color: #ffffff}
-
.input.btn {color:#666666; font: bold small 'trebuchet ms',helvetica,sans-serif;
-
background-color: #eeeeee;
-
border:1px solid;
-
border-color: #66CCFF #66CCFF #66CCFF #66CCFF;
-
font-size:11px;
-
}
-
-
//a {
-
// position: right;
-
// top: 5pt ;
-
// left: 10pt ;
-
//}
-
-
//a2 {
-
// position: left;
-
// top: 80pt ;
-
// left: 80pt ;
-
//}
-
-
-
.style17 {color: #666666}
-
.style18 {color: #CC6699}
-
.style19 {color: #CCCCCC}
-
.style22 {font-family: Verdana; color: #CCCCCC;}
-
.style23 {color: #66CCFF}
-
.style24 {
-
color: #99FF66;
-
font-weight: bold;
-
}
-
.style26 {color: #99FF66}
-
.style27 {color: #999999}
-
.stylered {color: #FF0000}
-
.stylegreen {color: #00FF00}
-
-
</STYLE>
-
-
-
-
<SCRIPT LANGUAGE="text/JavaScript">
-
function FRESHEN()
-
{
-
window.location.reload();
-
}
-
</SCRIPT>
-
-
-
-
<SCRIPT LANGUAGE="text/JavaScript">
-
function go_back_1()
-
{
-
history.go(-1);
-
}
-
</SCRIPT>
-
-
-
-
<SCRIPT LANGUAGE="text/JavaScript">
-
function go_back_2()
-
{
-
history.go(-2);
-
}
-
</SCRIPT>
-
-
-
-
-
<SCRIPT LANGUAGE="text/JavaScript">
-
function showLoc2()
-
var a = document.getElementById("link");
-
a.addEventListener("click", go_back_1, false);
-
if (window.location.hash == "#top")
-
{
-
a.firstChild.nodeValue = "TWO";
-
a.removeEventListener("click", go_back_1, false);
-
a.addEventListener("click", go_back_2, false);
-
}
-
</SCRIPT>
-
-
-
</head>
-
-
-
-
<!---
-
<BODY onload = "TOOT();">
-
-->
-
<BODY>
-
-
-
-
-
-
<!---
-
<a href "#" onclick = "go_back_1" id="link">ONE</a>
-
-
<a href onclick = "go_back_1(this.href);return false" id="link">ONE</a>
-
-->
-
-
-
-
<?php
-
$count=$_GET['count'];
-
$fac= strtoupper($_GET['fac']);
-
$SRG_GROUP=$_GET['SRG_GROUP'];
-
$SFT=$_GET['SFT'];
-
?>
-
-
-
-
-
-
<br>
-
-
<table width = "300" height = "10" align = "left" border = "0" class = "border">
-
<tr>
-
<td>
-
<form method="post" name = "searchFORM" action="<?php echo $PHP_SELF;?>">
-
<span style='color: #008b8b; font-size: 10pt; font-family: arial'>
-
    <b>search </b><input type="number" size="24" class = "INPUTWHITE" maxlength="20" name="SEARCH" value="<?php echo $_POST['search'];?>"
-
</span>
-
<!---
-
<input type="submit" value=">" name="submit" class = "btn">
-
-->
-
   
-
<b>
-
<a href="#" onclick="javascript:document.forms.searchFORM.submit();">go</a>
-
</b>
-
</form>
-
<br>
-
</td>
-
</tr>
-
</table>
-
-
<br>
-
<br>
-
<br>
-
-
-
-
<?php
-
-
#echo $_SERVER['REQUEST_URI']
-
#echo "<a href = 'COUNTTEST.php'>HOME</a><br><br>";
-
-
-
-
-
echo "<a name=top></a><br>";
-
-
echo "<A HREF='javascript:javascript:history.go(-1)'>HOME</A><br><br>";
-
-
$SEARCH = $_POST["SEARCH"];
-
-
-
-
-
-
-
-
echo "<div align = 'right'><SCRIPT LANGUAGE='JavaScript'>";
-
echo " function TOOT() ";
-
echo " { ";
-
echo " var x = window.location.hash; ";
-
echo "if (x == '#top')";
-
echo "{ ";
-
echo "document.body.innerHTML += '<a href=\'javascript:javascript:history.go(-2)\'>BACK </a>';";
-
echo "}";
-
echo "else";
-
echo "{";
-
echo "document.body.innerHTML += '<a href=\'javascript:javascript:history.go(-1)\'>BACK</a>';";
-
echo "}";
-
echo "}";
-
echo "</SCRIPT></div>";
-
-
-
-
print "<span style='color: #008b8b; font-size: 20pt; font-family: arial'><b>";
-
-
echo $count;
-
echo "<br>";
-
print "</b></span>";
-
print "<span class='style17'><font face = 'arial' size = '1'>";
-
-
if(isset($_GET['SFT']))
-
{
-
echo "<span style='color: #666666; font-size: 8pt; font-family: arial'>$_GET[SFT]</span><br><br>";
-
}
-
else
-
{
-
echo "<span style='color: #666666; font-size: 8pt; font-family: arial'>all shifts</span><br><br>";
-
}
-
-
-
-
echo $fac;
-
echo "<br>";
-
echo $SRG_GROUP;
-
echo "<br><br>";
-
print "</font></span>";
-
-
-
#!empty checks if the variable is NOT empty
-
#if(empty($_GET['SFT']) AND empty($_GET['fac']))
-
#{
-
#echo "one";
-
#}
-
#elseif(empty($_GET['SFT']) AND !empty($_GET['fac']))
-
#{
-
#echo "two";
-
#}
-
#elseif(isset($_GET['SFT']) AND empty($_GET['fac']))
-
#{
-
#echo "three";
-
#}
-
#else
-
#{
-
#echo "four";
-
#}
-
-
-
-
$conn=odbc_connect('ERVOLUMES','','');
-
if (!$conn)
-
{exit("Connection Failed: " . $conn);}
-
-
#if(isset($_GET['SFT']))
-
-
#if(empty($_GET['SFT']) AND empty($_GET['fac']))
-
#{
-
#$sql="SELECT [patient account number] AS patient_account_number, dischargeday, hospitalcode, age, [discharge time] AS discharge_time FROM 1_shift WHERE SRG_GROUP = '".$SRG_GROUP."' AND admitday ='".$count."'";
-
#}
-
#elseif(empty($_GET['SFT']) AND isset($_GET['fac']))
-
#{
-
#$sql="SELECT [patient account number] AS patient_account_number, dischargeday, hospitalcode, age, [discharge time] AS discharge_time FROM 1_shift WHERE SRG_GROUP = '".$SRG_GROUP."' AND hospitalcode LIKE '".$fac."' AND admitday ='".$count."'";
-
#}
-
#else
-
#{
-
#$sql="SELECT [patient account number] AS patient_account_number, dischargeday, hospitalcode, age, admit_shift, [discharge time] AS discharge_time FROM 1_shift WHERE SRG_GROUP = '".$SRG_GROUP."' AND admit_shift = '".$_GET['SFT']."' AND admitday ='".$count."'";
-
#}
-
-
-
-
-
if(empty($_POST['SEARCH']))
-
{
-
if(empty($_GET['SFT']) AND empty($_GET['fac']))
-
{
-
$sql="SELECT [patient account number] AS patient_account_number, dischargeday, hospitalcode, age, [discharge time] AS discharge_time FROM 1_shift WHERE SRG_GROUP = '".$SRG_GROUP."' AND admitday ='".$count."'";
-
}
-
elseif(empty($_GET['SFT']) AND !empty($_GET['fac']))
-
{
-
$sql="SELECT [patient account number] AS patient_account_number, dischargeday, hospitalcode, age, [discharge time] AS discharge_time FROM 1_shift WHERE SRG_GROUP = '".$SRG_GROUP."' AND hospitalcode LIKE '".$fac."' AND admitday ='".$count."'";
-
}
-
elseif(isset($_GET['SFT']) AND empty($_GET['fac']))
-
{
-
$sql="SELECT [patient account number] AS patient_account_number, dischargeday, hospitalcode, age, admit_shift, [discharge time] AS discharge_time FROM 1_shift WHERE SRG_GROUP = '".$SRG_GROUP."' AND admit_shift = '".$_GET['SFT']."' AND admitday ='".$count."'";
-
}
-
else
-
{
-
$sql="SELECT [patient account number] AS patient_account_number, dischargeday, hospitalcode, age, admit_shift, [discharge time] AS discharge_time FROM 1_shift WHERE SRG_GROUP = '".$SRG_GROUP."' AND admit_shift = '".$_GET['SFT']."' AND hospitalcode LIKE '".$fac."' AND admitday ='".$count."'";
-
}
-
}
-
-
-
-
-
if(!empty($_POST['SEARCH']))
-
{
-
if(empty($_GET['SFT']) AND empty($_GET['fac']))
-
{
-
$sql="SELECT [patient account number] AS patient_account_number, dischargeday, hospitalcode, age, [discharge time] AS discharge_time FROM 1_shift WHERE SRG_GROUP = '".$SRG_GROUP."' AND patient_account_number = '12686900' AND admitday ='".$count."'";
-
}
-
elseif(empty($_GET['SFT']) AND !empty($_GET['fac']))
-
{
-
$sql="SELECT [patient account number] AS patient_account_number, dischargeday, hospitalcode, age, [discharge time] AS discharge_time FROM 1_shift WHERE SRG_GROUP = '".$SRG_GROUP."' AND hospitalcode LIKE '".$fac."' AND patient_account_number = '12686900' AND admitday ='".$count."'";
-
}
-
elseif(isset($_GET['SFT']) AND empty($_GET['fac']))
-
{
-
$sql="SELECT [patient account number] AS patient_account_number, dischargeday, hospitalcode, age, admit_shift, [discharge time] AS discharge_time FROM 1_shift WHERE SRG_GROUP = '".$SRG_GROUP."' AND admit_shift = '".$_GET['SFT']."' AND patient_account_number = '12686900' AND admitday ='".$count."'";
-
}
-
else
-
{
-
$sql="SELECT [patient account number] AS patient_account_number, dischargeday, hospitalcode, age, admit_shift, [discharge time] AS discharge_time FROM 1_shift WHERE SRG_GROUP = '".$SRG_GROUP."' AND admit_shift = '".$_GET['SFT']."' AND hospitalcode LIKE '".$fac."' AND patient_account_number = '12686900' AND admitday ='".$count."'";
-
}
-
}
-
-
-
-
if(!empty($_POST['SEARCH']))
-
{
-
print "<span style='color: #008b8b; font-size: 12pt; font-family: arial'><b>";
-
echo "search results for:";
-
print " ";
-
echo $SEARCH;
-
print "</b></span>";
-
}
-
-
-
-
-
$rs=odbc_exec($conn,$sql);
-
-
-
-
print "<hr size = 1 width = 400 align = left color = #666666>";
-
print "<span style='color: #008b8b; font-size: 10pt; font-family: arial'><b>";
-
echo "details <br>";
-
print "</b></span>";
-
-
-
echo "<br><table width = '500' height = '10' align = 'left' border = '0'>";
-
echo "<tr height = '10'>";
-
echo "<td width = '100' height = '10'><b>ADMIT DAY</b></td>";
-
echo "<td width = '100' height = '10'><b>AGE</b></td>";
-
echo "<td width = '100' height = '10'><b>DISCH DAY</b></td>";
-
echo "<td width = '100' height = '10'><b>PT ACCT#</b></td>";
-
echo "<td width = '100' height = '10'><b>DISCH TIME</b></td>";
-
echo "</tr>";
-
echo "</table><br>";
-
-
echo "<br><table width = '500' height = '10' align = 'left' border = '0'>";
-
-
-
if (!$rs)
-
{exit("Error in SQL");}
-
while (odbc_fetch_row($rs))
-
{
-
-
-
$DISDAY=odbc_result($rs, dischargeday);
-
$AGE=odbc_result($rs, age);
-
$PTACCTNO=odbc_result($rs, patient_account_number);
-
$DISCHTIME=odbc_result($rs, discharge_time);
-
-
-
-
echo "<tr height = '10'>";
-
echo "<td width = '100' height = '10'>$count</td>";
-
echo "<td width = '100' height = '10'>$AGE</td>";
-
echo "<td width = '100' height = '10'>$DISDAY</td>";
-
echo "<td width = '100' height = '10'>$PTACCTNO</td>";
-
echo "<td width = '100' height = '10'>$DISCHTIME</td>";
-
echo "</tr>";
-
-
-
-
-
#echo $count;
-
#echo "    $AGE   $DISDAY   $PTACCTNO   $DISCHTIME<br>";
-
-
-
}
-
-
-
-
echo "<tr height = '10'>";
-
#echo "<td width = '100' height = '10'><br><a href='#top' onClick='window.location.reload( true );'>back to top</a></td>";
-
echo "<td width = '100' height = '10'><br></td>";
-
echo "<td width = '100' height = '10'>";
-
-
-
-
echo "<div align = 'right'><SCRIPT LANGUAGE='JavaScript'>";
-
echo " function showLoc() ";
-
echo " { ";
-
echo " var x = window.location.hash; ";
-
echo "if (x == '#top')";
-
echo "{ ";
-
echo "document.body.innerHTML += '<a href=\'javascript:javascript:history.go(-2)\'>TWO </a>';";
-
echo "}";
-
echo "else";
-
echo "{";
-
echo "document.body.innerHTML += '<a href=\'javascript:javascript:history.go(-1)\'>ONE</a>';";
-
echo "}";
-
echo "}";
-
echo "</SCRIPT></div>";
-
-
-
echo "</td>";
-
echo "<td width = '100' height = '10'></td>";
-
echo "<td width = '100' height = '10'></td>";
-
echo "<td width = '100' height = '10'><b></td><br>";
-
echo "</tr>";
-
-
-
echo "</table><br><br><br>";
-
-
-
-
-
-
-
?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
</html>
-
-
-
error pointing to line 345
While we wait <-- post must have crossed in the ether, for the requested code I thought I should pass on some experience I had recently.
I bought a CMS (don't ask why, I should have built the site myself) that used Access as the DB. This was a disaster. Running Access over the web - as I assume you are given that this is a PHP forum - Access can't handle concurrent usage that the web requires.
The only solution was for me to convert the DB to MySQL and now it works a treat. I say a treat there are other issues relating to coding standards but that's another issue.
My word of advice is if your system is web based or needs many users accessing the data at the same time then switch from Access to MySQL or SQL Server now and save yourself from a world of pain.
There you have it, I hope that was helpful.
I should say that you can easily switch the database over using Bullzip converter as I did but beware of special characters.
Cheers
nathj
Don't need to see the whole thing; just the parts that relate to the query and the error given. Thanks.
Also, outputting all that html is really very unhealthy. Have a look at the Heredoc syntax.
i really think it has something to do with the line 163... not matching up with the correct datatype... or some quotes or something missing in the query string. but im not sure how to fix this.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Polar |
last post by:
I am having troubles finding the parse error in this script. I've been
checking for weeks. I am too new to the subject I guess.
I am trying to show a readord and them have a form at the bottom...
|
by: jaysonsch |
last post by:
Hello!
I am having some problems with a database query that I am trying to do.
I am trying to develop a way to search a database for an entry and
then edit the existing values. Upon submit, the...
|
by: Nick Truscott |
last post by:
<?
// scoreinput.php - input a match score when match selected from list
?>
<html>
<head>
<basefont face="Verdana">
</head>
<body>
|
by: Mattyboy |
last post by:
Guys
I have built a database with saved queries that runs fine in Access
but when I call it from the web using ASP, an exception occurs. I
have tried multiple ways of testing the databases with...
|
by: Martin Lacoste |
last post by:
Ok, before I headbutt the computer... don't know why when I add
criteria in a query, I get an 'invalid procedure call'. I also don't
know why after searching the help in access, the various access...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
| |