I get a problem when I am collection more then one column from a row in my mysql-db using fbsql
When I am fetching a single column it is similar to this:
Code: Select all
set row [sql "SELECT id FROM list_setitem WHERE id='$text'"]
if { $row == ""} {
putdcc $brukerid "No matches to your query - $text -. Please redefine your searchstring."
sql disconnect
return 0
} else {
putdcc $brukerid "\002You are now offering $row\002\nRemember to update your webpage! (.update)"
sql disconnect
return 0
}
Code: Select all
<nso> .+offer 41
<d2> You are now offering 41
<d2> Remember to update your webpage! (.update)
this is all fine and dandy.
but if I want to select more columns, this is the result:
(selecting 'id,name' in the sql instead of just 'id')
Code: Select all
<nso> .+offer 123
<d2> You are now offering {123 {Trang-Oul's Guise}}
<d2> Remember to update your webpage! (.update)
So basicly there is generated unwanted {} around the individual columns.
When utilizing the full script I'm off course going to use lindex to split the variable up, but that is made very difficult by these {}.
I could off course use regsub, but that is a dirty solution, and I would really like to have a better way of doing it.
Any feedback would be appreciated.
Cheers, nso
edit: just realized that I had pasted the wrong bit of code. sorry. corrected now