Buen día
Estoy creando un programita en el cual estoy utilizando tablas de bases de datos en Mysql y Foxpro.
Al tratar de ver los datos obtenidos de las tablas de FoxPro me aparece el siguiente mensaje: "Table 'vatech.rdc' doesn't exist", "vatech" es la base de datos utilizada en Mysql no en FoxPro.
A continuación el código que estoy utilizando:
Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../../includes/style.css" type="text/css">
<?php
include("../../config.inc.php");
include_once("../../includes/cookies.inc.php");
protect();
$qy1 = "SELECT firstname, lastname FROM users WHERE roleid=35 AND active=1 OR roleid=42 AND active=1";
$rsl1 = $conn->Execute($qy1) or die($conn->ErrorMsg()."<br />$qy1");
$ruser = $rsl1->fields["lastname"];
$numfil1 = $rsl1->RecordCount();
$qy2 = "SELECT descripcion FROM proveedoresservicios ORDER BY descripcion";
$rsl2 = $conn->Execute($qy2) or die($conn->ErrorMsg()."<br />$qy2");
$rprove = $rsl2->fields["descripcion"];
$numfil2 = $rsl2->RecordCount();
$smarty->display("../header.tpl");
$conn1 = &ADONewConnection('odbc');
$connString = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=$_vfp_path/compra1/;Exclusive=No;Collate=Machine;";
$conn1->Connect("$connString");
$conn1->SetFetchMode(ADODB_FETCH_ASSOC);
$conn2 = &ADONewConnection('odbc');
$connString = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=$_vfp_path/compra2/;Exclusive=No;Collate=Machine;";
$conn2->Connect("$connString");
$conn2->SetFetchMode(ADODB_FETCH_ASSOC);
//include('../../includes/conex.php');//conexion al servidor real
?>
<html>
<body>
<p align="center">
<b>SELECCIONE LAS OPCIONES DE BUSQUEDA</b>
</p>
<br><br><br><br><br><br><br><br>
<form name="datos" METHOD="post">
<table align="center" bgcolor=#EEEEEE>
<tr>
<td colspan="3">
<?php
for($i=0;$i<$numfil1;$i++){
if($varcon == ($rsl1->fields["lastname"]))
$selec1 = "selected";
else
$selec1 = " ";
$opc1 .= "<option ".$selec1.">".$rsl1->fields["lastname"].$rsl1->fields["firstname"]."</option>";
$rsl1->MoveNext();
}
echo"</td><td>";
echo"<SELECT name=\"usuario\" style=\"width:220px\">
<OPTION>Seleccione Usuario</OPTION>
<OPTION>$opc1</OPTION>
</SELECT>";
?>
</td><td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr>
<td colspan="3">
<?php
for($i=0;$i<$numfil2;$i++){
if($varcon == ($rsl2->fields["descripcion"]))
$selec2 = "selected";
else
$selec2 = " ";
$opc2 .= "<option ".$selec2.">".$rsl2->fields["descripcion"]."</option>";
$rsl2->MoveNext();
}
echo"</td><td>";
echo"<SELECT name=\"prove\" style=\"width:220px\">
<OPTION>Seleccione Proveedor</OPTION>
<OPTION>$opc2</OPTION>
</SELECT>";
?>
</td><td></td>
</tr>
</td></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr>
<td colspan="3">
</td><td>             <input type="text" name="rdc" SIZE="20" value="Escribe la RDC ó RDC_C" ONCLICK="datos.rdc.value=' '"></td>
</tr>
</td></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
</table>
<br><br>
</table>
<br><br>
<p align=center>
<input type="submit" name="aceptar" value="Buscar" class="boton">
</p>
</form>
</body>
</html>
<?
$anyrdc=$_POST['rdc'];
$qry="SELECT * FROM rdc where rdc=$anyrdc";
$res=$conn1->Execute($qry) or die($conn1->ErrorMsg()."<br />$qry");
if ($res->fields["rdc"] == 0){
$qry="SELECT * FROM rdc WHERE rdc=$anyrdc";
$res=$conn2->Execute($qry) or die($conn2->ErrorMsg()."<br />$qry");
}
$pager = new pager(array("query" => $qry,
"sort" => $sort,
"currentPage" => $_GET["currentPage"],
"doNotUseCache" => true,
"pageSize" => 50,
"filter" => $filter,
"defaultTitleHeader" => "nowrap",
"fieldNames" => array(
"rdc" => "RDC",
"corre" => "Correlativo",
"odc" => "ODC",
"descripcio" => "Descripción",
),
"cellProperties" => array(
"rdc" => "align=center",
"corre" => "align=center",
"odc" => "align=center",
),
"rowProperties" => array("bgcolor=whitesmoke onmouseover=this.style.backgroundColor='#B0C4DE' onmouseout=this.style.backgroundColor=''",
"bgcolor=#EFEFEF onmouseover=this.style.backgroundColor='#B0C4DE' onmouseout=this.style.backgroundColor=''"),
"showFields" => $showFields,
"tableHeader" => "cellspacing=1 cellpadding=2 _bgcolor=black",
));
$smarty->assign("griddata",$pager->GRIDDATA);
$smarty->assign("navmenus",$pager->NAVMENUS);
$smarty->assign("next",$pager->nextPageLink);
$smarty->assign("prev",$pager->prevPageLink);
$smarty->assign("registros",$pager->numOfRecords);
$smarty->assign("rdc", $anyrdc);
echo"RDC: $anyrdc";
echo "
<table>
<tr>
<td border=\"2\">" .$pager->NAVMENUS; echo"</td>";
echo " </tr>
<tr>
<td></td>
</tr>
<tr>
<td border=\"2\"><a href=\"abastecimientos.php?pedido=$anyrdc\">" .$pager->GRIDDATA; echo"</a></td>";
echo " </tr>
<tr>
<td border=\"2\">" .$pager->prevPageLink.$pager->NAVMENUS.$pager->nextPageLink; echo"</td>";
echo " </tr>
<tr>
<td border=\"2\"><input type=\"hidden\" name=\"rdc\" value=\"$anyrdc\">"; echo"</td>
</tr>
</TABLE> ";
$smarty->display("../footer.tpl");
?>
Por su ayuda muchas gracias, y bonito día