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-10-2012, 11:16 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 657,080
Hall of Famer is on a distinguished road
Default

umm the mysql update query wont work? Well I've had problems like this at times but theres really an easy way to debug. The mysql query string may have a typo in it, or the variables used to locate or update the database contain wrong information. To debug, lets consider the example below:

PHP Code:
runquery("UPDATE {$prefix}adoptables_conditions SET promocode='{$code}' WHERE type='{$type}'"); 
The query string is enclosed in the function runquery. The variable $code is used to update database info, while the other variable $type is used to locate the specific row in a table. You can debug by outputting values inside the variables $code and $type to the screen and see if they contain the correct information. If so, you've apparently made a typo with the query string. Otherwise, chances are you've incorrectly assigned values to $code or $type.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #2  
Old 03-10-2012, 12:30 PM
!Alive !Alive is offline
Member
 
Join Date: Feb 2012
Posts: 39
Gender: Male
Credits: 1,857
!Alive is on a distinguished road
Default

PHP Code:
$number=rand(1,2);
    if (
$number == 2){
    
runquery("UPDATE ".$GLOBALS['prefix']."users SET explore='1' WHERE username".$GLOBALS['loggedinname']);
    
    
$query "SELECT * FROM ".$GLOBALS['prefix']."users WHERE username".$GLOBALS['loggedinname'];
    
$result mysql_query($query);
    
$explore=@mysql_result($result,0,"explore");
    echo 
"$explore";

    return 
$explore;
    if (
$explore == 1){
    
header'Location: browseprize.php' ) ;
        }
        } 
That's my code I'm running. I don't think I have any sytax errors, but I'm still new to this so I could be wrong.
Reply With Quote
Reply


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
Database Query: COUNT(*) Kyttias Questions and Supports 5 01-19-2015 03:57 AM
CSS Query .-. ChibiMaestro Templates and Themes 2 12-08-2012 05:51 AM
Errors Running Mysidia Inf3rnal Questions and Supports 10 03-04-2011 07:31 AM
Join query for optimization? Arianna Questions and Supports 2 04-09-2010 12:32 PM
Problems getting the script running.... milay Questions and Supports 7 03-08-2009 07:21 AM


All times are GMT -5. The time now is 02:55 AM.

Currently Active Users: 2398 (0 members and 2398 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