SitePoint Sponsor

User Tag List

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

    Mini-Script Problems

    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. if i put something like $result != null it does but it doesn't update add_total and adds the same user twice. please help

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Los Angeles, California
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is this the whole script? because you didnt log into mysql or select a db.......
    www.iyeinteractive.com - Website Design and Programming
    www.totalnonsense.net - my site, Under Construction

  3. #3
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i did do both but i made my own global.php files with a pconnect. but that's almost all of it except for hte table above but i'm 100% sure that the table names and the variables there match


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
  •