SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: update table

  1. #1
    SitePoint Enthusiast int3rface's Avatar
    Join Date
    Jun 2003
    Location
    Hull
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    update table

    ahhhhh,

    anyway I want to use update to add some info to a table but it want add the content fopr some reason, please help!

    PHP Code:
    if (isset($_POST['submit'])):

      
    $report $_POST['reporttext'];
      
    $hscore $_POST['hscore'];
      
    $ascore $_POST['ascore'];
      
    $manofthematch $_POST['manofthematch'];
      
    $id $_POST ['ID'];
       
      
    $sql "UPDATE fixtures SET
              reporttext ='
    $report',
              hscore = '
    $hscore',
              ascore = '
    $ascore',
              manofthematch = '
    $manofthematch'
              WHERE ID = '
    $id'
              "


  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) Double check you have types/cases/variable names matching exactly
    2) Use mysql_error() to tell you what the problem is
    3) Check each variable (particularly $ID) is getting set by echoing them.
    4) Check your if works. Do a simple echo "********!"; to check the update statement is even being accessed.
    5) If all else fails, go to the pub
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    SitePoint Enthusiast int3rface's Avatar
    Join Date
    Jun 2003
    Location
    Hull
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    will do thanks, just wanted to double check the syntax was correct, guess it will be one of those stupid little things.

    will do pub after football :-)

  4. #4
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by int3rface
    will do pub after football :-)
    You have West Ham colours
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  5. #5
    SitePoint Enthusiast int3rface's Avatar
    Join Date
    Jun 2003
    Location
    Hull
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    we may be getting a new kit in dif colours (with our names on!), so glad I used CSS for the formating loads of time saved!

  6. #6
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Glasgow Ranger's myself

    We have now won the 3 Scottish Cups this season;

    Happy ? Damn right we are Be beat Celtic because we are the better team

    ...

  7. #7
    SitePoint Enthusiast int3rface's Avatar
    Join Date
    Jun 2003
    Location
    Hull
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    returning to subject

    it was a silly mistake forgot to add the hidden id input

    PHP Code:
    <input type="hidden" name="ID" value="<?=$id?>" />
    Thanks.

  8. #8
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's always the little 'uns
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky


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
  •