Hello,
Was wondering if someone could point me in the right direction - have spent a day or two trying this on my own to no avail. Am somewhat of a nubbie, so my excuse ...
I have a CHAR defined field within a table that has several "words" to select from.
When I run this under SQL Plus it works fine, but under PHP I get many errors.
Here's the SQL Plus:
select count (*) from dist_term where term_type = 'PEDUN' or term_type = 'PEDPR';
I'd like to return a numeric value as a total - but PHP doesn't seem to like the CHAR field. Right now I return:
OCIStmtExecute: ORA-00911: invalid character
Have found this post which am pretty sure is what am after but still can't seem to get it. Please help - am getting a bit desperate ... Thanx.
RE: Count Words Function
if (preg_match("/[0-9a-zA-Z ]{3,20}$/",$string))
{
echo "yes";
}
else
{
echo "no";
};
/[0-9a-zA-Z]{3,20}$/
means:
^ - must be the beginning of the string
[ ] - whatever is between these brackets must match
0-9 - any number from 0 to 9
a-z - any letter from a to z (in lower case)
A-Z - any letter from A to Z (in upper case)
{3,20} - whatever was directly in front of this must match at least 3 and at most 20 times.
$ - must be the end of the string