Comparing Values


Posted on 16th Feb 2014 07:03 pm by admin

Hi
I'm reading data from a database and this seems to work OK.

Each system has an associated series of references..

Code:

Code: $dn = "cn=System";
$filter="(objectclass=*)";
$values = array('cn','telephone','id','intref','dataref','sysref');
$sr=ldap_list($ds, $dn, $filter, $values);
$info = ldap_get_entries($ds, $sr);
for ($n=0; $n<$info['count']; $n++) {
$cn = $info[$n]['cn'][0];
$tele[$cn] = $info[$n]['telephone'][0];
$id[$cn] = $info[$n]['id'][0];
$intref[$cn] = $info[$n]['intref'][0];
$dataref[$cn] = $info[$n]['dataref'][0];
$sysref[$cn] = $info[$n]['sysref'][0];
}

foreach ($tele as $key => $value) {

echo $key . " - Phone: " . $value . " - ID: " . $id[$key] . " - intref: " . $intref[$key] . " - dataref: " . $dataref[$key]. " - sysref: " . $sysref[$key]. "
";

}
What I'm trying to do is
Code:

Code: if id = intref, or id = dataref or id = sysref
then display intref or dataref or sysref in bold.

Obviously I need to check to see if ID from any of the systems match any of the refs.

I think that makes sense !!

No comments posted yet

Your Answer:

Login to answer
67 Like 52 Dislike
Previous forums Next forums
Other forums

PHP form authentication
Hi guys,

what am trying to achieve is this: Whenever a user tries to login to my website, an

convert PHP array to Javascript array
I have a page that gets a request sent from AJAX, and I am trying to convert a PHP array to a javasc

Material Issuing for receiving batch
Dear All experts in MM/ PP,

Material issuing from main stores to factory is currently usi

Checking if field is empty AND using !is_numeric
Hi lads,

Need to be able to display an error message (using isset?) that says "Cant lea

Table trouble
i have been reading the forum for a few weeks and decided to join. i like the format and the advice

Adding delete feature to my forum
Hello I am currently trying to add a delete feature to my forum. I believe I have everything built r

Help with usergroups? prolly really quick
So were coding our own forums for a game system we made an we have the users level setup but now I n

php and downloading
I want to use a php script to create two files. Then I want it to redirect (or whatever) to have tho

need to add "sizes" to shopping cart
Hey guys, I am trying to figure out a way to add a "size" selector on to this bit of code.

.htpasswd Registration Form
Hi,
I wanted to make an htpasswd registration form.
I found this code on the internet but have

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash