help me!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

help me!

Post by itsmani1 »

hello every one !
see the code given below!

Code: Select all

<?PHP
	  $QrCtry = "select country from tbl_university";
	  $ress = mysql_query($QrCtry);
	  $numm = mysql_num_rows($ress);

?>
now what i want to do is that i want to do is that i want to retrive only unique countries.
means if a country name exists twice in the tab_university i want it once only.
can any one help me regarding this.

and 2nd thing is that tried this:

Code: Select all

<?PHP

$input = "what do ya want for nothing?";
$hash = mhash (MHASH_MD5, $input);
print "The hash is ".bin2hex ($hash)."<br />\n";
$hash = mhash (MHASH_MD5, $input, "Jefe");
print "The hmac is ".bin2hex ($hash)."<br />\n";

?>
and instead of getting result i got:
Fatal error: Call to undefined function: mhash() in C:\mannan\mannan.php on line 11
can any body tell to over come it?
and plz. tell me how to download mambo
User avatar
thomas777neo
Forum Contributor
Posts: 214
Joined: Mon Mar 10, 2003 6:12 am
Location: Johannesburg,South Africa

RE: Help Me

Post by thomas777neo »

For a unique set of data from a field:

SELECT DISTINCT field FROM table

As for your mhash problem, in your php.ini file. uncomment the line

extension=php_mhash.dll

then restart your webserver
Post Reply