freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: kenn <kenn AT printussery.com>
- To: freetds <FreeTDS AT lists.ibiblio.org>
- Subject: [freetds] sql problem?
- Date: Fri, 11 Aug 2006 15:09:28 -0500
Okay, this is probably a failure on my part to understand, but the
following code works on the SQL server itself:
SELECT AAPTHEAD.ESTNO, AAPTHEAD.PARTNO, AAPTHEAD.PARTDES,
AAPTHEAD.PARTDES2, AAPTHEAD.LEAV1, AAPTHEAD.LEAV2, AAPTHEAD.LEAV3,
AAPTHEAD.LEAV4, AAPTHEAD.LEAV5, AAPTHEAD.LEAV6,
AASTOCKS.MATERIAL
FROM AAPTHEAD INNER JOIN
AASTOCKS ON AAPTHEAD.ESTNO = AASTOCKS.ESTNO AND
AAPTHEAD.PARTNO = AASTOCKS.PARTNO
WHERE (AAPTHEAD.ESTNO = '90763') AND (CAST(AAPTHEAD.PARTNO AS int) =
'1')
returns the expected answers ...
but when I try the following, the variables are always empty ....
$query = mssql_query("SELECT ESTNO, PARTNO, PARTDES, PARTDES2
FROM AAPTHEAD
WHERE (ESTNO = '$estimate_number') AND (CAST(PARTNO AS int) = '1')
");
if ($row = mssql_fetch_array($query)) {
do {
$estnumber = $row["AAPTHEAD.ESTNO"];
echo "part description for part $i is $estnumber <br>";
}
while($row = mssql_fetch_array($query)); } else {print "<p> No matches
found.";}
What am I doing wrong? (And if I should be posting this to the PHP
list, my apologies ....)
Kenn
- [freetds] sql problem?, kenn, 08/11/2006
Archive powered by MHonArc 2.6.24.