Using quite string, sscanf, mysql.
#1

Hello guys! I want to make something like this:
- I'm using sscanf for getting the string '0:0:0:2:0:0:1:0:0' for example from the database.
- I'm using something like objVar[ 0 ] will be 0, obsVar[ 3 ] will be 2 and so on.
- My question it's how can I update just the value of the fourth number from that string?
(The reason it's that i don't wanna use format for creating a string with 35 values "%d:%d:%d...%d" [35 times]).
Reply
#2

You shouldn't store more than one atomic value in a single column to begin with. This violates 1NF. If you've got too many values you should instead create another table exclusively for that so that you can have rows instead of columns.
Reply
#3

Why creating another table?... "035 others" = one string in the database
Reply
#4

BUNP
Reply
#5

Table is better because SQL doing the splits for you well and can be JOIN.
Reply
#6

Nobody understand what i want to do... I just want to change the value of the third number from this string using sscanf: "0:0:2:0:0:1:0:0".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)