I have a search page where you select the table you want to search, enter in a customer id and a package id. On my search_results page, I have the folowing code to connect to our sql server database, run a sql query and display the results. I am getting connected (I believe, not getting any errors), but I am not getting any data. Here is my code if someone could please help. Thanks.
<?
include "DB.php";
include "dbconn.php";
include "config.php";
function sqllookup() {
$conn_id = odbc_connect("sqlserverNGPS","appngph","vorfa");
$sql = "SELECT * FROM " . $table . "WHERE CustNbr = $cust_nbr";
print $sql;
$result=@odbc_do($conn_id, $sql);
for ($i=1; $i<= $numrows; $i++) {
odbc_fetch_row($result,$i);
$sql_last_nme = odbc_result($result,"LST_NME");
}
}
?>
It is not printing my $sql code, or anything. Even if I put in a print statement right after the function sqllookup() code, it doesn't print. I kind of need this fast, so any sppedy help would be greatly appreciated.
thanks again!!