hello all experts,
basically, i have a very small project, in which 97% of the work is complete. yet there is an issue which i cannot solve and i have no error to indicate what the problem is.Perhaps, in this case, it might just be a bad thing
I have 2 webpages, one with a datepicker in jscript with an id/name ="calendar";
this passes its value back into a textbox which is then submitted to the second webpage(databas e driven- mssql)... the variable $ts holds the passed value.
$ts then forms part of an mssql query which is then used to search the database and a result is supposed to be outputted.
however, the result variable only holds 'resource id#4' and no data is displayed and output to the screen from the database even though there should be matching records.... BUT when i have a simple static select statement, we recieve output to the page.
i have some code below.
CALENDAR PAGE::
when i change the stamp variable to $stamp = "select stamp from dates where stamp < $ts";then i get the error
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor., SQL state 01000 in SQLExecDirect in C:\Program Files\Apache Software Foundation\Apac he2.2\htdocs\pr intTrial.php on line 58
Warning: odbc_num_rows() : supplied argument is not a valid ODBC result resource in C:\Program Files\Apache Software Foundation\Apac he2.2\htdocs\pr intTrial.php on line 60
no rows that match
Warning: odbc_next_resul t(): supplied argument is not a valid ODBC result resource in C:\Program Files\Apache Software Foundation\Apac he2.2\htdocs\pr intTrial.php on line 69
but i suppose in reality that is only one error/warning, because they all follow suit.
PLEASE PLEASE PLEASE HELP!
thankyou very much for your time
please reply asap,it would bring me back to sanity(at the very least!)
P.S. THE ONLY THING I CAN THINK OF, IS A MATCH BETWEEN DATE FORMATS, WHERE THE SEPERATOR '-'HAS BEEN USED IN THE CALENDAR, I ALSO WHAT WHAT looks like!!!! a '-' in mssql tables... but i think this is also improbable.
can you also please tell me if u CANNOT HELP, atleast then i know people are trying to help!
imran
basically, i have a very small project, in which 97% of the work is complete. yet there is an issue which i cannot solve and i have no error to indicate what the problem is.Perhaps, in this case, it might just be a bad thing
I have 2 webpages, one with a datepicker in jscript with an id/name ="calendar";
this passes its value back into a textbox which is then submitted to the second webpage(databas e driven- mssql)... the variable $ts holds the passed value.
$ts then forms part of an mssql query which is then used to search the database and a result is supposed to be outputted.
however, the result variable only holds 'resource id#4' and no data is displayed and output to the screen from the database even though there should be matching records.... BUT when i have a simple static select statement, we recieve output to the page.
i have some code below.
CALENDAR PAGE::
Code:
<form name="tstest" method="GET" action = "printTrial.php"> <input type="text" id="calendar" name="calendar" /> <button id="trigger">...</button> PRINTTRIAL.PHP:: [I][B]$ts = $_GET['calendar']; $stamp = "select stamp from dates where stamp < '" & ts & "'"; $result = odbc_exec($connect,$stamp); if(odbc_num_rows($result) == 0) { echo 'no rows that match'; } else { echo ' there are matching records'; } // this returns '' there are matching records'; if (odbc_next_result($result)){ while ($rs = odbc_fetch_array($result)) { echo $rs. ' this is $rs'; $compname=odbc_result($rs,"stamp"); echo "<td><p>$compname[stamp]</td></tr>"; } } odbc_close($connect);[/B][/I]
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor., SQL state 01000 in SQLExecDirect in C:\Program Files\Apache Software Foundation\Apac he2.2\htdocs\pr intTrial.php on line 58
Warning: odbc_num_rows() : supplied argument is not a valid ODBC result resource in C:\Program Files\Apache Software Foundation\Apac he2.2\htdocs\pr intTrial.php on line 60
no rows that match
Warning: odbc_next_resul t(): supplied argument is not a valid ODBC result resource in C:\Program Files\Apache Software Foundation\Apac he2.2\htdocs\pr intTrial.php on line 69
but i suppose in reality that is only one error/warning, because they all follow suit.
PLEASE PLEASE PLEASE HELP!
thankyou very much for your time
please reply asap,it would bring me back to sanity(at the very least!)
P.S. THE ONLY THING I CAN THINK OF, IS A MATCH BETWEEN DATE FORMATS, WHERE THE SEPERATOR '-'HAS BEEN USED IN THE CALENDAR, I ALSO WHAT WHAT looks like!!!! a '-' in mssql tables... but i think this is also improbable.
can you also please tell me if u CANNOT HELP, atleast then i know people are trying to help!
imran
Comment