Forums Register Login

more than one values for a single message

+Pie Number of slices to send: Send
Hi,

I need to get the values from database in ascending order.I will explain you in detail.I have two columns in my mysql table "ivr". The first column is messages and the second column is order_no.like the following


message order_no

welcome 1
Thank you 4
How are you 3
bob 2



Here The messages should be printed in order by order_no like
welcome
bob
How are you
Thank you.
This is perfect. But if I need to give two order numbers for one message like ,For the message bob I need to give the order number 2 and also 5, How should i store the order number in database?Can i store it like 2,5?Is it possible?

Thanks

+Pie Number of slices to send: Send
The only way i can think of is having two entries in the table one as [bob,2] and the other as [bob,5].
+Pie Number of slices to send: Send
Thanks. You mean i have to insert the fields two times.first for the value 1 and the other for the value 5?
+Pie Number of slices to send: Send
Yes that's what i meant. Look out for other suggestions also. But this is the only possibility i see.
+Pie Number of slices to send: Send
if you want to print bob twice at different places in your program, why you have to make another entry in table?
+Pie Number of slices to send: Send
Then how should i do this. If i insert two times bob and its order number,i can able to print the bob in the locations according to the order number.

+Pie Number of slices to send: Send
 

preethi Ayyappan wrote:Then how should i do this. If i insert two times bob and its order number,i can able to print the bob in the locations according to the order number.



that was acceptance or a question? I assumed you need to print bob more than once in different places. If it is not, then explain it again.
+Pie Number of slices to send: Send
ok, I think I am getting your point. Can you put in hshmap, where keys are order and values are your messages?
+Pie Number of slices to send: Send
yes. you got my point.can you please explain me in brief? How to put in hashmap?I have no idea about that
+Pie Number of slices to send: Send
 

preethi Ayyappan wrote:How to put in hashmap?I have no idea about that



I fyou don't want to make another entry in table, then you need to hardcode the order for your corresponding message, that second bob will always come in 5th position. here 5 will be the key and bob will be the value. Something like that.
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 826 times.
Similar Threads
Query Regarding XML DOM Parser use in Java
servlet to another client
a strange problem on "rs.getString()"
Hibernate sorting issue
nested exception is java.sql.SQLException: Invalid column index
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:52:08.