Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder maxvee8's Avatar
    Join Date
    Feb 2008
    Location
    UK
    Posts
    185
    Thanks
    19
    Thanked 18 Times in 18 Posts

    Is this right a a IF AND && Statement... Cant Get it to work.. Help plz

    hi i want this statement to be IF ?? AND ?? do wht ever looka the the code and make it right lol.. cant get it workin


    PHP Code:
    if ($_POST['submit'] == 'Submit Crime' && $yearRecorded=='2008'){
    $queryaddcrime=mysql_query("INSERT INTO markers (name,address,lat,lng,type,yearRecorded) VALUES ('$name','$address','$lat','$lng','$type','$yearRecorded')");
    //same thing as above, but will last for 3600 seconds, or one hour from the current time.
    mysql_query ($queryaddcrime);

    Max
    "I have not failed, I've found 10,000 ways that don't work" Thomas Edison

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Location
    Quebec
    Posts
    261
    Thanks
    6
    Thanked 7 Times in 7 Posts
    Looks fine to me. Where is $yearRecorded set?

  • #3
    Regular Coder maxvee8's Avatar
    Join Date
    Feb 2008
    Location
    UK
    Posts
    185
    Thanks
    19
    Thanked 18 Times in 18 Posts
    PHP Code:
    $yearRecorded=$_POST['yearRecorded']; 
    year entered id being posted comin from a text field

    Code:
    "<label id='labels'>Year Crime Rec:</label><SELECT name=yearRecorded ><OPTION value='2008'>2008</OPTION><OPTION value='2007'>2007</OPTION></SELECT>" + "<br />"
    "I have not failed, I've found 10,000 ways that don't work" Thomas Edison

  • #4
    Regular Coder
    Join Date
    Mar 2007
    Location
    Quebec
    Posts
    261
    Thanks
    6
    Thanked 7 Times in 7 Posts
    Post the rest of the form & script please. The syntax looks fine to me, so it could be a typo somewhere.

  • #5
    Regular Coder maxvee8's Avatar
    Join Date
    Feb 2008
    Location
    UK
    Posts
    185
    Thanks
    19
    Thanked 18 Times in 18 Posts
    FIXED IT THANKS FOR THE HELP, I DID IT ALL AGAIN Dont know wht the poblem was
    Last edited by maxvee8; 03-16-2008 at 08:28 PM.
    "I have not failed, I've found 10,000 ways that don't work" Thomas Edison


  •  

    Posting Permissions

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