Modify Contact in mSQL database

\n"); $in=open("../UserName", "<|"); if ($in<0) { echo("Error: $ERRMSG\n"); fatal(); } $user=chop(readln($in)); $userc=$user + "_category"; close($in); $sock = msqlConnect("localhost"); if ($sock < 0) { printf("

%s

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

%s

\n", $ERRMSG); fatal(" "); } if (msqlQuery($sock, "select rbr,name,surname,titula,jobtitle,company,dept,h_street,h_city,h_zip,h_country,h_phone,w_street,w_city,w_zip,w_country,w_phone,mailing_addr,pager,mobil_phone,email,home_page,categories,public,w_account,account,fax from $user where rbr=$no")<0) { printf("

%s

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

\n"); $hh=0; while($hh<26) { if ($row[$hh]=="") { $row[$hh]=""; } $hh=$hh + 1; } echo("\n"); echo("
First Name: |
\n"); echo("
Last name: |
\n"); echo("
Title: |
\n"); echo("
Job title: |
\n"); echo("
Home Address:
\n"); echo("
Address: |
\n"); echo("
City: |
\n"); echo("
Zip: |
\n"); echo("
Country: |
\n"); echo("
Phone: |
\n"); echo("
Business Address:
\n"); echo("
Company: |
\n"); echo("
Department: |
\n"); echo("
Address: |
\n"); echo("
City: |
\n"); echo("
Zip: |
\n"); echo("
Country: |
\n"); echo("
Phone: |
\n"); echo("
Fax: |
\n"); echo("
Account Data:
\n"); echo("
Business Acc: |
\n"); echo("
Personal Acc: |
\n"); echo("
\n"); echo("
Pager: |
\n"); echo("
Mobile: |
\n"); echo("
\n"); echo("
E-mail: |
\n"); echo("
Home Page: |
\n"); echo("
\n"); echo("
Categories: | \n"); $categories=$row[22]; if (msqlQuery($sock, "select nmbr, code from $userc order by nmbr")<0) { printf("
%s
\n", $ERRMSG); fatal(""); } $res=msqlStoreResult(); $row=msqlFetchRow($res); if (#$row > 0) { $rr=-1; while(#$row > 0) { $rr=$rr + 1; $opt[$rr]="$row[1]"; $row=msqlFetchRow($res); } msqlFreeResult($res); $hh = 0; while($hh < 4) { $hh = $hh + 1; $nm = "categ" + (char)$hh; echo(""); echo(" \n"); } } echo("
\n"); $fdf = ""; if ((int)$row[23] == 1) { $fdf="CHECKED"; } echo("
\n\n"); echo("\n"); echo("
\n

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