If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Question about selectStatement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-08-04, 16:49
digital_storm digital_storm is offline
Registered User
 
Join Date: Dec 2003
Posts: 28
Question about selectStatement

Hello!

I have an onlineregistrationsystem for tennisgame, my problem is that when I summerize all the maches some of the matches arent played
I have declared:
-----------------------
String res="";
String query= "SELECT * FROM tid WHERE f1name='anders' AND e1name='andersson' AND f2name='carl' AND e2name=jonsson'";
res= rs.getString("query");

(rs is my selectStatement)
-----------------------------------
what will happen if no game with the players "anders andersson" and "carl jonsson" has been played? Will my res be set to null or?

I have tried to check with if(res.equals(null)) and if(res.equals(""))

but it doesent work.

How should I overcome this little problem?

Regards // D_S
Reply With Quote
  #2 (permalink)  
Old 02-09-04, 10:24
calum433 calum433 is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen
Posts: 12
Re: Question about selectStatement

Don't know if you copide and pasted this in from your code but there is a slight error. Missing a ' before jonsson.

This would result in the query failing and if you are not testing for that then being unable to successfully check the results.
Reply With Quote
  #3 (permalink)  
Old 02-09-04, 10:45
digital_storm digital_storm is offline
Registered User
 
Join Date: Dec 2003
Posts: 28
Hello!

Thank you for taking your time helping me.

This is just an example what I want to do..... Its not my "real" syntax.
My "real syntax" is correct. I have tried with other SELECT statements, matches that has been played.

Thanks again/ D_S
Reply With Quote
  #4 (permalink)  
Old 02-09-04, 10:56
reneeb reneeb is offline
Registered User
 
Join Date: Jan 2004
Location: Germany
Posts: 167
try:
Code:
if(res == NULL){...}
__________________
board.perl-community.de - The German Perl-Community
Reply With Quote
  #5 (permalink)  
Old 03-20-09, 21:29
royachago royachago is offline
Registered User
 
Join Date: Mar 2009
Posts: 1
What a Refreshing Place

Hey everybody, it's been way too long since I've popped my head in to say hello to everyone. I've been around looking at all the comments and replies to everyone, but I haven't joined until today ! This forum is very informative and I'm hoping to learn more.

Looking forward to sharing ideas with everyone! And everyone is so nice (even though you dont even know me yet). It's a lot of fun reading about where everyone is at. I hope everyone has a great weekend and we'll talk soon.

I'm pretty happy to be here!

Last edited by r937; 03-20-09 at 22:00.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On