Raised This Month: $12 Target: $400
 3% 

Concatenates 2 string into a mysql query


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.|Pim's
Junior Member
Join Date: Feb 2010
Old 09-15-2010 , 15:56   Concatenates 2 string into a mysql query
Reply With Quote #1

Hi

i find how to concatenates 2 string into a query

Code:
INSERT INTO test_db (filename, password, text) VALUES ('%s', '%s', '%s') ON DUPLICATE KEY UPDATE text = CONCAT(text, %s) ", filename, password, text, text);
I find how to concatenates the old text with the new in the database

Example : old text = Hello
new text = how are you ?
text = Hello how are you ?

Thank's for your help and i'm sorry for my bad english i'm french
.|Pim's is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 09-15-2010 , 20:47   Re: Concatenates 2 string into a mysql query
Reply With Quote #2

Try StrCat: http://docs.sourcemod.net/api/index....ad=show&id=643
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
.|Pim's
Junior Member
Join Date: Feb 2010
Old 09-16-2010 , 11:48   Re: Concatenates 2 string into a mysql query
Reply With Quote #3

yes but its in a Querry :S
i try to get the old text with SQL_FetchString and add the new text but my text weighs +2000 bytes :S

How can i make this easily?


Thank's you
.|Pim's is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 09-16-2010 , 11:52   Re: Concatenates 2 string into a mysql query
Reply With Quote #4

1 of the very first links in Google:
http://www.tutorialspoint.com/mysql/...t-function.htm
FaTony is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode