Jump to content

Archived

This topic is now archived and is closed to further replies.

eric07

Newbie Help

Recommended Posts


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.

Share this post


Link to post
Share on other sites
not sure i get you. what do you mean by sending the data without using the submit button?

Share this post


Link to post
Share on other sites
[!--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.

Share this post


Link to post
Share on other sites
[!--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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.