SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    addition in MySQL

    can i add an integer to a content of a column in MySQL??

    EXAMPLE:

    PHP Code:
    $sql mysql_query("update table set quantity = quantity + 1 WHERE id = 2"); 
    ONLY LaZiO and ArGaNTiNa ...

  2. #2
    SitePoint Member
    Join Date
    Apr 2004
    Location
    Vancouver, WA
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes you can. Just as you have written it.

    Bill

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    BG
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, but the column 'quantity' must be integer or float in order to be able to add integer values to it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •