saving colors into mysql (using sscanf)
#1

removed
Reply
#2

My face now is like: "What the hell..."

Where you "query" the database?

The code you gived is more than useless...
Reply
#3

i am talking about the code, the query works fine. (when i try it other way around i get this "581034239")

Edit: and nothing is useless 10MIN, everything here has a meaning.
Reply
#4

Those snippets you posted make no sense. It is supposed to look like 581034239 because that is an integer value. The fact that it doesn't look like what you're used to is because integer values are stored in base 10 rather than base 16. If you execute
PHP код:
SELECT HEX(581034239); 
You'll get
Код:
22A1E0FF
Note that you should not use the HEX function in a normal select, this is just for demonstration purposes.
Reply
#5

The query is not working (you said that it inputs 0 in mysql table)... Also you don't need sscanf... Also read What is the difference in representing colours this way #ffffff and 0xffffff?

Also the query should be like:
format(query,sizeof(query),"INSERT INTO colors SET group_color = %d", groupinfo[gruid][color])
E:Vince was faster than me
Reply
#6

thanks vince, and thanks to you too for replying 10min.

Edit: should've used inttohex -_-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)