FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

new to ddbi - quick question

 
Post new topic   Reply to topic     Forum Index -> DDBI
View previous topic :: View next topic  
Author Message
wolftousen



Joined: 28 Jan 2008
Posts: 10

PostPosted: Sun Apr 26, 2009 8:35 pm    Post subject: new to ddbi - quick question Reply with quote

Ok, used dsss net install ddbi and it went fine (except it kept asking me for a file name and I had no clue what to give it so skipped all that...)

I have my program running, i'm just wondering if there is a simpler way to get the data out of result.

Here is all my dbi code:

Code:
//create and connect to my database
...
//username and password are defined as char[] elsewhere
auto result = db.query("select status from accounts where username='" ~ username ~ "' and password='" ~ password ~ "';");
...
//this is where i would like something simplier to type and easier to read
status = toInt(result.rows.next.stringAt(0));


This is what I want, but when I do this it fails to give me the proper value:
Code:

//create and connect to my database
...
//username and password are defined as char[] elsewhere
auto result = db.query("select * from accounts where username='" ~ username ~ "' and password='" ~ password ~ "';");
...
status = toInt(result.rows.next.stringAt("status"));


Anyone have any insight?

Btw, having Docs and a small tutorial for each database type that covers both querying and fetching would be very helpful.

And, i haven't used MySQL in PHP in a while, but i seem to remember the query giving a result and then result had a fetch function which gave you a char[][], this would be very nice here...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DDBI All times are GMT - 6 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group