Get information for mysql
#12

Quote:
Originally Posted by JaTochNietDan
Quote:
Originally Posted by Joe Staff
Shouldn't it be "SELECT * FROM mytable WHERE ..." ? I've made my own MySQL login system before and I think that doing "SELECT Whatever" would select a column called 'Whatever' whereas the '*' is all columns. You could also do "SELECT Username,Password FROM mytable ..." and that would get you the columns you're looking for anyway.
Why would you use SELECT *? He doesn't need to retrieve every single column in the entire row just for logging someone in. Also, it was an example, I don't know what columns he has.

Zafire are you using any type of encryption on the passwords?

EDIT: I just noticed this..

pawn Код:
if(!strcmp(cmdtext, "/login", true, 3)) // 3 is the length of /me
3 may be the length of /me but it's not the length of /login
Hehe this was funny, I just came back and looked again on that thread and realized.
SELECT * FROM means to select everything 1 after 1, a whole row. So there's no need to that.



Eh checked your code again..
Quote:

format(query, sizeof(query),"SELECT Whatever FROM `table` WHERE Username = '%s' AND Password = '%s'", name, pass);
samp_mysql_query(query);
samp_mysql_store_result();

wtf?
Reply


Messages In This Thread
Get information for mysql - by Zafire1410 - 23.08.2009, 20:56
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 21:00
Re: Get information for mysql - by MenaceX^ - 23.08.2009, 21:00
Re: Get information for mysql - by Joe Staff - 23.08.2009, 21:11
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 21:11
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 21:28
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 21:32
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 21:45
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 21:50
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 21:51
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:04
Re: Get information for mysql - by MenaceX^ - 23.08.2009, 22:04
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:12
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:13
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:15
Re: Get information for mysql - by MenaceX^ - 23.08.2009, 22:17
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:20
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:22
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:25
Re: Get information for mysql - by MenaceX^ - 23.08.2009, 22:26
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:30
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:34
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:36
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 22:46
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 22:53
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 23:01
Re: Get information for mysql - by JaTochNietDan - 23.08.2009, 23:03
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 23:08
Re: Get information for mysql - by MenaceX^ - 23.08.2009, 23:16
Re: Get information for mysql - by Zafire1410 - 23.08.2009, 23:18

Forum Jump:


Users browsing this thread: 1 Guest(s)