note 47431 added to function.odbc-connect

From: Date: Tue, 16 Nov 2004 11:04:24 +0000
Subject: note 47431 added to function.odbc-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-80583@lists.php.net to get a copy of this message
Hi Mario, I changed a bit your script to suit my configuration, I also included a lines to close the connection. Thanks for the script I am running apache 2.0.52 and PHP 5.0.2. Windows 2000 SQL 2000 <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF"> <table width="75%" border="1" cellspacing="1" cellpadding="1" bgcolor="#FFFFFF"> <tr bgcolor="#CCFFFF"> <td height="22"><b>Tipo</b></td> <td height="22"><b>Marca</b></td> <td height="22"><b>Modelo</b></td> </tr> <?php $cx=odbc_pconnect("RAMPANT","Invent","pass",""); $cur=odbc_exec($cx,"select tipo,marca,modelo from inv_equipos"); while(odbc_fetch_row($cur)) { //collect results $tipo=odbc_result($cur,1); $marca=odbc_result($cur,2); $modelo=odbc_result($cur,3); //format and display results print ("<tr>"); print ("<td>$tipo</td>"); print ("<td>$marca</td>"); print ("<td>$modelo</td>"); print ("</tr>"); } //disconnect from database odbc_close($cx); ?> </table> </body> </html> ---- Manual Page -- http://www.php.net/manual/en/function.odbc-connect.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47431 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47431&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47431&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47431&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47431&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47431&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47431&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47431&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80583) next »