Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-16-2008, 07:46 PM   PM User | #1
maxvee8
Regular Coder

 
maxvee8's Avatar
 
Join Date: Feb 2008
Location: UK
Posts: 185
Thanks: 19
Thanked 18 Times in 18 Posts
maxvee8 is an unknown quantity at this point
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
maxvee8 is offline   Reply With Quote
Old 03-16-2008, 08:08 PM   PM User | #2
fl00d
Regular Coder

 
Join Date: Mar 2007
Location: Quebec
Posts: 261
Thanks: 6
Thanked 7 Times in 7 Posts
fl00d has a little shameless behaviour in the past
Looks fine to me. Where is $yearRecorded set?
fl00d is offline   Reply With Quote
Old 03-16-2008, 08:13 PM   PM User | #3
maxvee8
Regular Coder

 
maxvee8's Avatar
 
Join Date: Feb 2008
Location: UK
Posts: 185
Thanks: 19
Thanked 18 Times in 18 Posts
maxvee8 is an unknown quantity at this point
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
maxvee8 is offline   Reply With Quote
Old 03-16-2008, 08:15 PM   PM User | #4
fl00d
Regular Coder

 
Join Date: Mar 2007
Location: Quebec
Posts: 261
Thanks: 6
Thanked 7 Times in 7 Posts
fl00d has a little shameless behaviour in the past
Post the rest of the form & script please. The syntax looks fine to me, so it could be a typo somewhere.
fl00d is offline   Reply With Quote
Old 03-16-2008, 08:23 PM   PM User | #5
maxvee8
Regular Coder

 
maxvee8's Avatar
 
Join Date: Feb 2008
Location: UK
Posts: 185
Thanks: 19
Thanked 18 Times in 18 Posts
maxvee8 is an unknown quantity at this point
FIXED IT THANKS FOR THE HELP, I DID IT ALL AGAIN Dont know wht the poblem was
__________________
"I have not failed, I've found 10,000 ways that don't work" Thomas Edison

Last edited by maxvee8; 03-16-2008 at 08:28 PM..
maxvee8 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:38 PM.


Advertisement
Log in to turn off these ads.