Reply to using msMSL and stored Procedures (EXEC)

Your name:

Reply:


Posted by shawn.ready on 08/28/06 11:36

Hi all

I am trying to get the following to work

<?php
$startPidpoint = $_REQUEST["startPidpoint"];
$endPidpoint = $_REQUEST["endPidpoint"];
$connectionstring = odbc_connect('DB','user','password');
$stmt = odbc_prepare($connectionstring, 'EXEC getHistoryLocation ?
?;');
$result =
odbc_execute($stmt,array($startPidpoint),array($endPidpoint));

header("Expires: Mon, 3 Jan 2000 08:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("content-type:text/xml");
echo "<locations>";
while (odbc_fetch_row($stmt)) {
$pidpoint = odbc_result($stmt,"pid");
$Latitude = odbc_result($stmt,"latitude");
$Longitude = odbc_result($stmt,"longitude");
$Speed = odbc_result($stmt,"speed");
$Angle = odbc_result($stmt,"angle");
echo ' <location id="'.$pidpoint.'" lat="'.$Latitude.'"
lng="'.$Longitude.'" speed="'.$Speed.'" angle="'.$Angle.'"/>';
}
echo "</locations>";

odbc_close($connectionstring);
?>

I think I have two problems,

1. Is the syntax for the "odbc_prepare" correct? Given this is a msSQL
Server,
2. odbc_execute returns a bool, so I can't use $result, but the $stmt
is a resource so I should be able to use the "odbc_fetch_row" but it's
not working.

Can anyone see what I am doing wrong.

Thanks

Shawn

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация