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

03-16-2008, 08:46 PM
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

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);


03-16-2008, 09:08 PM
Looks fine to me. Where is $yearRecorded set?

03-16-2008, 09:13 PM

year entered id being posted comin from a text field

"<label id='labels'>Year Crime Rec:</label><SELECT name=yearRecorded ><OPTION value='2008'>2008</OPTION><OPTION value='2007'>2007</OPTION></SELECT>" + "<br />"

03-16-2008, 09:15 PM
Post the rest of the form & script please. The syntax looks fine to me, so it could be a typo somewhere.

03-16-2008, 09:23 PM
FIXED IT THANKS FOR THE HELP, I DID IT ALL AGAIN Dont know wht the poblem was