Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2012, 03:13 AM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 42,486
fadillzzz is an unknown quantity at this point
Default

Assuming you have a unique index on the name field, this can be achieved without any additional query.

PHP Code:
$stmt $adopts->query('...');
if ( ! 
$stmt)
{
    
// failed, the name is already in use
}
else
{
    
// successfully renamed

I think this would be a much better solution, because not only that you keep the MySQL from choking, but you also keep your code succinct.

Last edited by fadillzzz; 03-27-2012 at 03:15 AM.
Reply With Quote
  #2  
Old 03-27-2012, 04:47 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 115,782
SilverDragonTears is on a distinguished road
Default

Pardon me for being ignorant... where do I put this and what do I put in the ('...')

Quote:
Originally Posted by fadillzzz View Post
Assuming you have a unique index on the name field, this can be achieved without any additional query.

PHP Code:
$stmt $adopts->query('...');
if ( ! 
$stmt)
{
    
// failed, the name is already in use
}
else
{
    
// successfully renamed

I think this would be a much better solution, because not only that you keep the MySQL from choking, but you also keep your code succinct.
__________________

Check out SilvaTales
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mys v1.3.4 Know Gender of New Pets Before Naming Kyttias Mys v1.3.x Mods 4 08-04-2018 01:13 AM
Show Gender while Naming Pet & Name Promo Code Pets Kyttias Questions and Supports 5 07-11-2014 02:12 PM
Naming and Changing Help whispwill Suggestions and Feature Requests 10 08-29-2009 02:58 PM


All times are GMT -5. The time now is 05:07 PM.

Currently Active Users: 3780 (0 members and 3780 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636