| |||
Error de conexion Buenas, como veran a continuación soy un novato de php empezando a formarse en este lenguaje, y por suspuesto tengo una duda (si no no estaria aca no?) necesito hacer una conexion entre una pequeña aplicación y MYSQL y me da el siguiente error "Call to undefined function dbx_connect() on line 4", estuve revisando los scripts para ver si identificaba el fallo pero no lo lacalizo, estoy usando WAMP 1.6.3 con PHP5, Apache2 y MYSQL5 y Windows XP, ya le habilite las extensiones a PHP DBX.dll y MYSQL.dll, Alguna IDea? Gracias de antemano. Última edición por Darkcom13; 09/05/2007 a las 06:49 |
| |||
Re: Error de conexion este es el codigo que estoy usando Este codigo PHP lo tengo en un archivo zciconfig.php <? class masterconfig {function dbconnect() {return dbx_connect(DBX_MYSQL,"localhost", "root", "zci",""); } } ?> Y este me dispara el problema de conexion <html> <head> <title>Registered Computers</title> <meta http-equiv="Pragma" content="no-cache"> <link rel=stylesheet type=text/css href="content.css"> </head> <body> <table border=2 width=100%> <tr><td class=contenttitle colspan=4>Registered Computers</td></tr> <tr class=catgmenu> <th width=25%><a href=registered_computer.php?type=all>All Computers</a></th> <th width=25%><a href=registered_computer.php?type=active>Active Computers</a></th> <th width=25%><a href=registered_computer.php?type=removed>Removed Computers</a></th> <th width=25%><a href=registered_computer.php?type=reserved>Reserve d Computers</a></th> </tr> <tr class=catgmenu> <th width=25%><a href=registered_computer.php?type=1000>Owned Computers</a></th> <th width=25%><a href=registered_computer.php?type=2000>Leased Computers</a></th> <th width=25%><a href=registered_computer.php?type=3000>Ownership End</a></th> <th width=25%><a href=registered_computer.php?type=4000>Lease End</a></th> </tr> <tr><td colspan=4> <form action=registered_computer.php?type=search method=post style=margin-bottom:0> Hostname : <input type=text name=hostname> User Name : <input type=text name=user> Domain : <input type=text name=domain> <input type=submit value=SEARCH> </form> </td></tr> <tr><td colspan=4><span class=myremark>Change Type of View to</span> : <button onclick="javascript:location.replace('registered_d evice.php?devtype=Monitor')">Monitor</button> <button onclick="javascript:location.replace('registered_d evice.php?devtype=Peripheral')">Peripheral</button> </td></tr> </table> <? include "../zciconfig.php"; include "../engine/zciobject.php"; if (isset($_GET['type'])) { echo "<table width=100% border=1><tr class=myth><th width=4%>Num.</th><th>Hostname</th><th>User Name</th><th>Domain</th><th>Registration<br>Date</th><th>Ownership</th><th>Ownerhip<br>Change Date</th><th>Reserved</th></tr>"; $masterconf = new masterconfig(); //make database connection $mydbcon = $masterconf->dbconnect(); $sqlstr=""; $str1=""; $str2="a.removed is null and b.computerid=a.computerid "; $str3=""; switch ($_GET['type']) { case "all": break; case "active" : $str1 = "a.modelid<2500 and "; $str3="and b.reserved is null"; break; case "removed" : $str1 = "a.modelid>2500 and "; break; case "reserved": $str1 = "a.modelid<2500 and "; $str3 = "and b.reserved is not null"; break; case "search": $str2="(b.hostname like '%".$_POST['hostname']."%' and b.user like '%".$_POST['user']."%' and c.name like '%".$_POST['domain']."%') and a.computerid=b.computerid and a.removed is null"; break; default : $str1 = "a.modelid=".$_GET['type']." and "; } $sqlstr="select a.computerid,b.hostname,b.user,c.name,b.registerda te,d.name,a.registerdate,b.reserved from ownership a,computer_system b,domain_category c,ownership_category d where ".$str1.$str2.$str3." and c.modelid=b.domain and d.modelid=a.modelid order by b.hostname,b.user"; $result=dbx_query($mydbcon,$sqlstr); for($i=0;$i<$result->rows;$i++) echo "<tr><td>".($i+1)."</td><td><a target=_blank href=computer_details.php?compid=".$result->data[$i][0].">".$result->data[$i][1]."</a></td><td>".$result->data[$i][2]. "</td><td>".$result->data[$i][3]."</td><td>".$result->data[$i][4]."</td><td>".$result->data[$i][5]."</td><td>".$result-> data[$i][6]."</td><td>".$result->data[$i][7]."</td></tr>"; dbx_close($mydbcon); echo "</table>"; } ?> </body></html> |
| ||||
Re: Error de conexion Revisaste viendo el phpinfo() si esta activada la extension, ya que por defecto existen en el Xampp existen dos archivos php.ini para su configuracion y se debe modificar ambos sino solamente se encuentra habilitado las funciones nativas de mysql que te mostro yournightmare86, saludos, cya
__________________ "El Conocimiento es de todos, no solo de algunos" |
| |||
Re: Error de conexion Tienen razón muchachos, no me esta cargando la extension dbx, pero solo encuentro un archivo PHP.INI en el WAMP5, dejenme revisar a ver si esta escondido en otra parte. |
| ||||
Re: Error de conexion
__________________ NO PERDAMOS NUESTRO LINDO IDIOMA ESPAÑOL |