VBDev
04-08-2004, 07:08 PM
Hurm, how to update a field of text to add sthg at then end ?
With a INT field, no problem, an update query with field = field + X works perfectly but I want to do this :
$DB_site->query("UPDATE ". TABLE_PREFIX ."password SET users=users & '$bbuserinfo[userid]' WHERE postid='$postid'");
This doesn't work
I've tried with + instead of the &, same result, it doesn't work correctly
By searchin on mysql.com (thanks Dean :lick: ), I found this function concat_ws but I don't know the exact structure and it doesn't work fine with this :
$DB_site->query("UPDATE ". TABLE_PREFIX ."password SET users=concat_ws(users,'$bbuserinfo[userid],') WHERE postid='$postid'");
It only replace my field with the new userid
How can I do this with only one query ?!
Thanks by advance
With a INT field, no problem, an update query with field = field + X works perfectly but I want to do this :
$DB_site->query("UPDATE ". TABLE_PREFIX ."password SET users=users & '$bbuserinfo[userid]' WHERE postid='$postid'");
This doesn't work
I've tried with + instead of the &, same result, it doesn't work correctly
By searchin on mysql.com (thanks Dean :lick: ), I found this function concat_ws but I don't know the exact structure and it doesn't work fine with this :
$DB_site->query("UPDATE ". TABLE_PREFIX ."password SET users=concat_ws(users,'$bbuserinfo[userid],') WHERE postid='$postid'");
It only replace my field with the new userid
How can I do this with only one query ?!
Thanks by advance