List contacts from mSQL database

%s

\n", $ERRMSG); fatal(""); } if (msqlSelectDB($sock,"contacts") < 0) { printf("

%s

\n", $ERRMSG); fatal(""); } echo("
\n"); if (msqlQuery($sock, "select DISTINCT rbr, company from $user where company CLIKE '$srch%' AND company<>'' order by company")<0) { printf("

%s

\n", $ERRMSG); fatal(""); } $res=msqlStoreResult(); $row=msqlFetchRow($res); if (#$row > 0) { echo("

\n"); printf("
Adresar (Companies)
\n"); while(#$row > 0) { printf("
%s
\n", $row[0], $row[1]); $row=msqlFetchRow($res); } echo("

\n"); } msqlFreeResult($res); if (msqlQuery($sock, "select rbr, name, surname from $user where surname CLIKE '$srch%' AND surname<>NULL OR name<>NULL order by surname, name")<0) { printf("

%s

\n", $ERRMSG); fatal(""); } $res=msqlStoreResult(); $row=msqlFetchRow($res); if (#$row > 0) { echo("

\n"); printf("
Adresar (Personal)
\n"); while(#$row > 0) { printf("
%s, %s
\n", $row[0], $row[2], $row[1]); $row=msqlFetchRow($res); } echo("

\n"); } msqlFreeResult($res); >