My first assignment when I started this job was to re-do the sign-in procedure for new employees. I was new to PHP and did kind of a messy job.
The problem I run into now is that when I wrote the insert to the employee table I made the ssn a varchar:
"insert into employ (ssn) values ('$ssn_in')"
and the previous version had it as an int:
"insert into employ (ssn) values ($ssn_in)"
(without the single quote)
is there a query or php function that will test the fields to see if they are numeric or varchar
i tried this :
while ($a=mysql_fetch_array($r)) {
if (is_string($a[ssn])) {
$var++;
}
if (is_numeric($a[ssn])) {
$num++;
}
echo "<p>$a[ssn]<br>NUMERIC: $num <br>VARCHAR: $var";
}
all the fields tested true for both numeric and string
the field descripion in the database is varchar(10)
i imagine this is a really dumb post :rolleyes:
any help appreciated