Jump to content

Changing data in a field without insert?


SirChick

Recommended Posts

Is there a way to do this:

 

say i have a field as "crimeexp"

 

say the value of crimeexp is 12

 

Now cos its integer format i want to just add to it instead of replacing.

 

So something like:

 

$CrimeEXP = ['crimeexp'];

 

$CrimeEXP + 12;

 

so the new value is now 24.

 

then some how make that new $CrimeEXP be the value in the table ? Or do i have to insert and if so will it overwrite the present data in that field? or will it just add to it like this: "1212" ?

Link to comment
https://forums.phpfreaks.com/topic/65098-changing-data-in-a-field-without-insert/
Share on other sites

not sure, but look in the manual for the to_int() function.  itll convert it to an integer for you.  its accepted the html frm as text.  not sure if thers an atrubute to change so that int isthe default datatype.... but itsbetter you do validation here.

 

no no. Basically this is what happens in logical sense:

 

 

Crime exp is 12 right...(in user table)

 

Now when the script runs this is what the script should do :

 

crimeexp + 12 = crimeexp

12        +  12  = 24

 

 

so now in the table crimeexp will say 24 instead of 12... you get me ?

 

 

in the table crimeexp is set as integer

 

 

i was thinking like "UPDATE tablename WHERE crimeexp * +12 "

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.