[PHP4BETA] Sybase error
| From: | Volker Hielscher | Date: | Thu, 22 Jul 1999 13:33:50 +0000 |
| Subject: | [PHP4BETA] Sybase error | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-2513@lists.php.net to get a copy of this message | ||
Hello,
it seems that the sybase.c file has Problems.
here is a piece of code that demonstrates the problem.
I select a few times the same things from a table.
Then assing the result to some variables.
But after a few runs the content of the variables have not the correct
value.
I think the sybase function overrides somthing in the variable stack and
then the variables become an other value.
the table I use has the name mytable and the fields:
mb_f004_f001_id int
mb_f004_f003_id int
mb_f004_value varchar(250)
mb_f004_sort int
the content is 10 times the same as you see below.
Hope you can help me.
By
Volker Hielscher
Example of the output in case of error:
-----------
Fehler !!
Inhalt oid: hallo , Inhalt ergebnis[mb_f004_f001_id] : 1
Inhalt ergebnis
>0 - 1<
>mb_f004_f001_id - 1<
>1 - 2<
>mb_f004_f003_id - 2<
>2 - hallo<
>mb_f004_value - hallo<
>3 - 0<
>mb_f004_sort - 0<
-----------------
Here is the code:
--------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<?
$conn = sybase_connect("SYBASE", "user", "pass");
sybase_select_db("template_mall",$conn);
$string = "select mb_f004_f001_id,mb_f004_f003_id,mb_f004_value,mb_f004_sort
from
mytable";
for($i = 0; $i < 100; $i++) {
$result = sybase_query($string,$conn);
//echo sybase_num_rows($result);
while($ergebnis = sybase_fetch_array($result)) {
$oid = $ergebnis["mb_f004_f001_id"];
$fid = $ergebnis["mb_f004_f003_id"];
$fvalue = $ergebnis["mb_f004_value"];
$fsort = $ergebnis["mb_f004_sort"];
if($oid <= 0) {
echo "Fehler !!<br>";
echo "Inhalt oid: $oid , Inhalt ergebnis[mb_f004_f001_id] :
$ergebnis[mb_f004_f001_id]<br>";
echo "Inhalt ergebnis<br>";
while(list($k,$v) = each($ergebnis)) {
echo ">$k - $v<<br>";
}
}
}
}
?>
</body>
</html>
--------------------------------
--
volker hielscher dipl. ing. (fh) [mailto:vh@dmc.de] [http://www.dmc.de]
digital media center gmbh
marienstrasse 41
d-70178 stuttgart (germany)
fon [49].[711].601747-40
fax [49].[711].601747-77