|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-08 10:11 UTC] stas at cvs dot php dot net
[2000-07-08 16:30 UTC] hunter at greenscarab dot org
[2000-07-11 11:20 UTC] joey at cvs dot php dot net
[2000-07-11 11:22 UTC] joey at cvs dot php dot net
[2000-07-24 23:39 UTC] joey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 18:00:02 2025 UTC |
Code: --- $already_found = array("NULL"); while ($spider_row = sybase_fetch_array($spider_result)) { $gp_result = sybase_query("SELECT * from SY01200 WHERE INET2 LIKE '%" . $spider_row["domain"] . "%'",$gp_db); if ($gp_result) { $gp_row = sybase_fetch_array($gp_result); if (! in_array($gp_row["Master_ID"],$already_found)) { $rowsum++; echo "<tr>\n"; echo "<td><font face=\"Verdana\" size=-1>"; echo $gp_row["Master_ID"]; echo "</font></td>\n"; echo "<td><font face=\"Verdana\" size=-1>REVENUE</font></td>\n"; echo "<td><font face=\"Verdana\" size=-1>LOCATION</font></td>\n"; echo "</tr>\n"; } if (! in_array($gp_row["Master_ID"],$already_found)) array_push($already_found,$gp_row["Master_ID"]); sybase_free_result($gp_result); } } sybase_free_result($spider_result); sybase_close($gp_db); --- The Master_ID column in the database has values such as "CUS0001" and "VEN0001" depending on the domain ($spider_row["domain"]). The array $already_found should include a list of the Master_ID values already listed to avoid duplicate entries. Instead, it returns all sorts of values into the array .. Here is an example of the results of two identical searches: Search 1: Name Revenue Location 3DC0002 REVENUE LOCATION USO0001 REVENUE LOCATION USO0001 REVENUE LOCATION Search 2: Name Revenue Location 3DC0002 REVENUE LOCATION USO0001 REVENUE LOCATION The results obviously show screwy values in the array. System info: Apache/1.3.12 (UNIX) (Red Hat/Linux) PHP/4.01pl2 mod_perl/1.21 Intel Celeron 500 w/ 64MB RAM Configure string: ./configure --with-apxs --with-sybase=/opt/sybase-11.9.2