SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: modifing table

  1. #1
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    modifing table

    this is a really newb question. if in user_total i have a number. how can i make that number increase by 1. i don't know yet how to do the mysql modify or change or whatever it's called but i will soon enough!

  2. #2
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh i found it. at php.net i looked everywhere and then i saw update

  3. #3
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good work =).

  4. #4
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem #2 :)

    php.net does really help
    Last edited by MrLister; Jun 14, 2001 at 15:26.

  5. #5
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    if ($action == "Submit") {
    $result_id mysql_query ("select max(cheat_id) from cheats_pc where cheat_id > '0'");
    list(
    $cheat_id) = mysql_fetch_row($result_id);
    $cheat_id $cheat_id 1;
    $DB_site->query("INSERT INTO cheats_pc (cheat_name, cheat_id, cheat_text, cheat_valid) VALUES ('$game_name', '$cheat_id', '$game_text', '-1')");

    $sql "SELECT add_user FROM cheats_users WHERE  add_user = '$add_user'";
    $result mysql_query($sql);
    if (
    $result == null){
      
    $userIP $REMOTE_ADDR;

      
    $DB_site->query("INSERT INTO cheats_users (add_user, add_total, add_ip) VALUES ('$add_user', '1', '$userIP')");
    }else{
     
    $result_id mysql_query ("select max(add_total) from cheats_users");
       list(
    $add_total) = mysql_fetch_row($result_id);
        
    $add_total $total+1;
     
    $DB_site->query("UPDATE cheats_users SET add_total='$total' WHERE name='$add_user'"); 
    this is the code i'm using but it doesn't do anything. it won't add a user or edit a user. please help


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
  •