Re: [PHP3] Newbie sybase-11.9.2 / php-3.0.16 connection prob
| From: | Michel | Date: | Thu, 08 Jun 2000 19:45:45 +0000 |
| Subject: | Re: [PHP3] Newbie sybase-11.9.2 / php-3.0.16 connection prob | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1330@lists.php.net to get a copy of this message | ||
I think the 2 mistakes are :
second ligne : a ; missing
third ligne is false
right sytaxe could be :
<?
$dbCon = sybase_connect("SYBASE","sa","Yourpassword") ;
if ($dbCon) {
sybase_select_db("pubs2");
echo "connection succeded";
$query = "select * from sysobjects where type =
'U'";
echo("<br> $query <br>");
$result = sybase_QUERY($query);
$number = sybase_NUM_ROWS($result);
$number_collonnes = sybase_NUM_FIELDS($result);
echo("il y a ".$number." lignes et
".$number_collonnes." colonnes <br>");
while($row = sybase_fetch_row($result)) {
echo('<br>');
while(list($k, $v) = each($row)) { echo "
$v\n "; }
}
sybase_close($dbCon );
}
else { echo "connection failed";}
?>
Michel
Doug Poland wrote:
> Hello,
>
> I'm running apache-3.1.12/php-3.0.15/sybase-11.9.2. I have
> have a simple .php3 file as such...
>
> <?
> $dbCon = sybase_connect("SYBASE","sa","")
> sybase_select_db("pubs2", $dbCon);
> ?>
>
> which returns the errors:
>
> Warning: Sybase: Unable to connect in
> /usr/local/share/apache/htdocs/sybase/default.php3 on line 2
>
> Parse error: parse error in
> /usr/local/share/apache/htdocs/sybase/default.php3 on line 3
>
> I can run sybase via isql. eg.,
>
> > isql -S SYBASE -U sa -P
> 1> select @@version
> 2> go
> Adaptive Server Enterprise/11.9.2/1075/P/Linux
> Intel/Linux 2.2.5 i586/OPT/Mon Jul 12 09:51:46 1999
> (1 row affected)
>
> Here is my interfaces file if that helps:
>
> # SYBASE on canaan.newresources.com
> ## Services:
> ## query tcp (7100)
>
> SYBASE
> query tcp ether canaan.newresources.com 7100
>
> Any idea where to go from here? Many TIA
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe@lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe@lists.php.net
> To search the mailing list archive, go to:
> http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin@lists.php.net