Link to home
Start Free TrialLog in
Avatar of Pedro Chagas
Pedro ChagasFlag for Portugal

asked on

Increment data to database (php - mysql)

Hi experts, in my database I have a field that have this kind of format, word word word word, in practice can be "great bottle water fresh" or more words.
That field in database can be editable, every time I put a new word I put them in the beggining of string, in practice if I want put a new word (ex. super) the result would be "super great bottle water fresh".

For i do the upgrade I use this steps:
Call database and get the string "great bottle water fresh"
join variables $newone + $database_result and becomes "super great bottle water fresh".
upgrade database

My question is, this is the best way for do that? have other way to increment database without call the $database_result?

Regards, JC
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Pedro Chagas

ASKER

Hi @angelIII, thanks for your feedback.
I thing you give me a great solution, the problem is I don't understand in that way, and I need a practical example.
Usually I use this code for update the database:
mysql_query("update words set palavras='$newwordstring' where id='$other_variable'", $db);
===================================

How I put your solution in my line of code?

Regards, JC
 
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial