Jump to content

Newbie Help


eric07

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.

Link to comment
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.
Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.