PDA

View Full Version : Mysql little explain


TheDeath
20/07/2012, 05:55 AM
Ok i fully know mysql but in samp i cant understand one how when i select some thing like
mysql_query(SELECT * FROM USER WHERE USERNAME='...some string');
So i want to ask how to save it as a new string in samp beacuse
Example:

new adminlevel[MAXPLAYERS];
so here i want to save some row from mysql in this String

namespace
20/07/2012, 06:45 AM
use format..
format(query,sizeof query, "SELECT * FROM USER WHERE USERNAME='%s'",..some string);
mysql_query(query);

TheDeath
20/07/2012, 07:37 PM
and then when i select it how to save it in sting ???
if i cant save it i cant do anything with mysql :(

ReneG
20/07/2012, 07:42 PM
Look at all the mysql/sqlite tutorials on the forum. ****** is your friend. To save items in a database it's the UPDATE clause.