ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-db
php-db
RE: [PHP-DB] simple issue
by Ankur Dave other posts by this author
Nov 21 2006 9:39PM messages near this date
Re: [PHP-DB] simple issue | Re: [PHP-DB] simple issue
Just chk your phpinfo() is odbc supprt is ebable in that. ??
If not need to enable odbc settings in that.

-=-=-=-=-=-=-=-=-=-
@nkur d@ve || http://ullu.wordpress.com


-----Original Message-----
From: Chris Carter [mailto:chandan9sharma@[...].com]
Sent: Wednesday, November 22, 2006 10:57 AM
To: php-db@[...].net
Subject: Re: [PHP-DB] simple issue


my code:

<html> 
<body> 

<?
$username="chris";
$password="carter";
$database="chris_phpb1";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM phpbb_banlist";
$result=mysql_query($query);

if (!$result)
  {exit("Error in SQL");}
echo "<table> <tr>";
echo "<th> Companyname</th>";
echo "<th> Contactname</th></tr>";
while (odbc_fetch_row($result))
{
  $compname=odbc_result($result,"CompanyName");
  $conname=odbc_result($result,"ContactName");
  echo "<tr> <td>$compname</td>";
  echo "<td> $conname</td></tr>";
}
odbc_close($conn);
echo "</table> ";
?> 

</body> 
</html> 

My error:

Fatal error: Call to undefined function: odbc_fetch_row() in
/home/chandan/public_html/deb.php on line 19
Companyname	Contactname

Also .. I am trying this live on cPanel compiler coz I could not install
the
PHP thing on my localhost. I have apache-tomcat-5.5.17 which works
perfectly
with jsp files but I do not understand what does it take to run a php
using
apache.

chris smith-9 wrote:
> 

>  Chris Carter wrote:
> > Hi,
> >

> > I am new to PHP, just trying a peace of code to access mySQL database
to
> > fetch and show result on web page. But getting errors. Can you help
me
> > with
> > this code please. Or if you have a very basic code where in I can do
some
> > insertion in the database.
> 

>  There are hundreds of mysql + php tutorials on the 'net - do a search
in
>  your preferred search engine.
> 

>  If you *still* can't work it out post a sample of the code you're
trying
>  to use and the errors you get.
> 

>  --

>  Postgresql & php tutorials
>  http://www.designmagick.com/
> 

>  --

>  PHP Database Mailing List (http://www.php.net/)
>  To unsubscribe, visit: http://www.php.net/unsub.php
> 

> 

> 


--
View this message in context:
http://www.nabble.com/simple-issue-tf2683559.html#a7485434
Sent from the Php - Database mailing list archive at Nabble.com.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



The information contained in, or attached to, this e-mail, contains confidential information
 and is intended solely for the use of the individual or entity to whom they are addressed a
nd is subject to legal privilege. If you have received this e-mail in error you should notif
y the sender immediately by reply e-mail, delete the message from your system and notify you
r system manager. Please do not copy it for any purpose, or disclose its contents to any oth
er person. The views or opinions presented in this e-mail are solely those of the author and
 do not necessarily represent those of the company. The recipient should check this e-mail a
nd any attachments for the presence of viruses. The company accepts no liability for any dam
age caused, directly or indirectly, by any virus transmitted in this email.

www.aztecsoft.com

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Chris Carter
John Comerford
Ankur Dave
Chris
Chris Carter
Jeffrey
Chris Carter
Chris
John Comerford
Chris

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved