Print the name from a field - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Print the name from a field (
/showthread.php?tid=455078)
Print the name from a field -
saamp - 31.07.2013
I have an row ( varchar type ) and I select it by ID. How can I print its string value?
pawn Код:
format(query,sizeof(query),"SELECT `Sender` FROM `Emails` WHERE `ID`=5 LIMIT 1");
Sender, in my table, for this query, has this value: "Jonathan".
How to get this name into a variable?
Re: Print the name from a field -
RajatPawar - 31.07.2013
Send that query, get it's result and use printf? You can always ******, it's not hard!
Re: Print the name from a field -
saamp - 31.07.2013
Now how can I print the result?
Re: Print the name from a field -
saamp - 01.08.2013
nobody?
Re: Print the name from a field -
QuaTTrO - 01.08.2013
pawn Код:
new name[MAX_PLAYER_NAME];
//Query here
mysql_store_result();
mysql_get_field("Sender", name);
printf("Name: %s", name);
mysql_free_result();
Re: Print the name from a field -
Vince - 01.08.2013
pawn Код:
mysql_fetch_row()
cache_get_row()
But you should use caching.