954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

[MySQL++] same code, no result from second application

Hello,

about 3 months ago I made simple chat using MySQL++ which is working fine, login function:

http://pastebin.com/Mdup4zi6

but today I'm creating Control Panel, I've copied and changed this function a little bit, but i'm getting 0 results (if I copy syntax to navicat I'll get password so...)

login function: http://pastebin.com/XmzdVzFx

the problem is that result.size is 0, even if I have right username in DB

queryy += "SELECT * FROM accounts WHERE login = '";
		queryy += lUsername;
		queryy += "'";

navicat and chat are returning 1 result (which is right)

lUsername is right (I made a check with MessageBox)

senergy
Light Poster
39 posts since Jun 2011
Reputation Points: 16
Solved Threads: 0
 

What is the value of queryy before that first += ?
Should that just be = ...on the first one?

thines01
Postaholic
Team Colleague
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
 

+= is ok there because he's using std::string

Your program probably needs to check for sql errors on return because it could be some other problem, such as not logged into mysql.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

I already fixed it, I was using release lib for debug mode :X

senergy
Light Poster
39 posts since Jun 2011
Reputation Points: 16
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You