eric07 Posted May 4, 2006 Share Posted May 4, 2006 I want to retrive variables from a URL which I assign to PHP variables ($_Request which I have done) - and I just want to update the set of record with this information (MySQL database) which I am having trouble with I also want it to exe as soon as the URL send this data without having to use submit button (executes straight away) and that will go back to another page.1. Is this possible and where can I find some examples. Quote Link to comment Share on other sites More sharing options...
.josh Posted May 4, 2006 Share Posted May 4, 2006 not sure i get you. what do you mean by sending the data without using the submit button? Quote Link to comment Share on other sites More sharing options...
eric07 Posted May 5, 2006 Author Share Posted May 5, 2006 [!--quoteo(post=371397:date=May 4 2006, 06:12 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 4 2006, 06:12 PM) [snapback]371397[/snapback][/div][div class=\'quotemain\'][!--quotec--]not sure i get you. what do you mean by sending the data without using the submit button?[/quote]yes without the submit button - i want to update a records as soons as the page is accessed. The information that it is to be update with is sent through URL. Quote Link to comment Share on other sites More sharing options...
Prismatic Posted May 5, 2006 Share Posted May 5, 2006 [!--quoteo(post=371611:date=May 5 2006, 12:14 PM:name=kim08)--][div class=\'quotetop\']QUOTE(kim08 @ May 5 2006, 12:14 PM) [snapback]371611[/snapback][/div][div class=\'quotemain\'][!--quotec--]yes without the submit button - i want to update a records as soons as the page is accessed. The information that it is to be update with is sent through URL.[/quote]This should get you going :) Not sure if the or die() will work in the if statment, if not, just remove it :)[code]<?php$Name = $_GET['name'];$Location = $_GET['location'];$Query = "UPDATE users SET location = '$Location' WHERE name = '$Name'"if(mysql_query($Query) or die(mysql_error()){ echo "Query successfully executed";}else{ echo "Query failed";}?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.