Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
zogalogran
Beginner


Joined: 23 Jun 2006
Posts: 20

PostPosted: Sun Mar 04, 2012 3:09 pm   

another noob question on #IF
 
I couldn't find a previous post on this, though I saw plenty of similar:

Code:

#IF row.RecordCount=0 {
    #ECHO boo   
    #ECHO boo
    $update=%concat("INSERT INTO `blah`.`blah` (`item_name`, `item_tags`) VALUES ('", @name, "', '", @tags, "');")
    #CALL @db.Execute($update)
  }


Now, the first #ECHO doesn't show up bolded - as in it isn't recognized by the editor as a command. This goes for ANYTHING I put on that line - it just spits it out as output.

The If statement logic seems to work well enough though (As in, it is properly registering and interpreting the value of row.RecordCount). I assume this is some syntactical miscue?

Thanks!
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Sun Mar 04, 2012 3:18 pm   
 
At first glance I see two problems. Try the following substitution.

Code:
#IF (@row.RecordCount=0) {
    #ECHO boo   
    #ECHO boo
    $update=%concat("INSERT INTO `blah`.`blah` (`item_name`, `item_tags`) VALUES ('", @name, "', '", @tags, "');")
    #CALL @db.Execute($update)
  }
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
zogalogran
Beginner


Joined: 23 Jun 2006
Posts: 20

PostPosted: Sun Mar 04, 2012 3:21 pm   
 
Thanks for the super-swift reply. This worked, and allowed me to debug the sql problems I was having very quickly. Thanks!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net