Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Allow different spelling of names (http://www.mysidiaadoptables.com/forum/showthread.php?t=3938)

SilverDragonTears 12-29-2012 02:32 PM

Allow different spelling of names
 
If someone has the name Holly for an adopt, how can I make it so that another person can use HoLLy, or some other variation of the same name?

Abronsyth 12-29-2012 02:37 PM

Not that I can answer this...but are users currently unable to give their pet the same name of another existing pet..?

SilverDragonTears 12-29-2012 02:38 PM

If you have it set up that way which I do. And I think that it's default.

Hall of Famer 12-29-2012 02:55 PM

You can use strcmp() function to validate the name of an adoptable with another. This one is case sensitive, so Adopt and adopt are not the same.

SilverDragonTears 12-29-2012 03:03 PM

Where do I place that at?

Hall of Famer 12-29-2012 04:28 PM

Place it where it validates adoptables name.

SilverDragonTears 12-30-2012 10:20 AM

I tried this but I don't think it's correct as it didn't work.

Code:

else{
                    $stmt = $adopts->query("SELECT * FROM ".constant('PREFIX')."owned_adoptables WHERE name='{$more}'");
                    $row = $stmt->fetchObject();
                    if(!is_object(strcmp($row))){
                      // The name has not yet been used, we are good to go!


Hall of Famer 12-30-2012 10:42 AM

Of course its not correct lol. You dont know how to use the strcmp() function dont ya? It accepts two arguments, not one. The arguments have to be strings, not objects. Try this:

PHP Code:

$name $adopts->query("SELECT name FROM ".constant('PREFIX')."owned_adoptables WHERE name='{$more}'")->fetchColumn();
if(!
strcmp($name$more)){
    
// The name has not be used...
}
else{
    
// Show error message



SilverDragonTears 12-30-2012 11:29 AM

Rawr, I'm not putting it in the right place :(

Code:

$name = $adopts->query("SELECT name FROM ".constant('PREFIX')."owned_adoptables WHERE name='{$more}'")->fetchColumn();
if(!strcmp($name, $more)){
                      // The name has not yet been used, we are good to go!
                        $adopts->query("UPDATE  ".constant('PREFIX')."owned_adoptables SET name='{$more}' WHERE aid='{$id}' and  owner='{$loggedinname}'");

It says it worked but it didn't change the name.

Hall of Famer 12-31-2012 03:03 AM

umm are you sure the query is executed correctly? I mean, do the variables $id and $more exist? If so, what values do they hold? Use var_dump($id) and var_dump($more) to validate their values. If one of them turns out to be blank or null, you know the problem.


All times are GMT -5. The time now is 05:06 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.