Jump to content

markerpower

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

markerpower's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm not sure how to add CONCAT into the current format of the following: $sql = "UPDATE " . USERS_TABLE . " SET numbers = " . ($user_id) . " WHERE user_id = " . $userdata['user_id']; Maybe to make it clearer of what my script is suppose to do. Lets say numbers = 1. When my script runs the first time, numbers= 1,2. When it runs another time, numbers= 1,2,3. This is how the numbers should appear in the database. With the numbers, and the numbers seperated by commas. Currently when my script runs it replaces the old number with the new number. For example if numbers= 1, then when the script runs the first time, numbers= 2. That's not what I want. I want the 1 to stay with the addition of the comma and 2.
  2. Hello, I need some help. I'm basically trying to figure out how to add multiple numbers seperated by commas in one column. Such as "1,2,3,4". Each time my script is ran it's suppose to add a new number in the column after the old number. My code is basically like this: $user_id = $user_id . "," . ($user_id + 1); $sql = "UPDATE " . USERS_TABLE . " SET numbers = " . ($user_id) . " WHERE user_id = " . $userdata['user_id']; But I get an error like: SQL Error : 101 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2 WHERE user_id = 2' at line 1 UPDATE user_numbers SET numbers= ,2 WHERE user_id = 2 It seems like it is having problems adding the 2 after the comma, and I can't figure out why. If anyone can help I appreciate it.
×
×
  • 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.