Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 00:23
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  MySQL, PostgreSQL, MS SQL, Access (Moderators: Flash-db, Musicman, Ronald Wernecke, Jorge Solis, Andries Seutens)
| | |-+  Updating information
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Updating information  (Read 1052 times)
ShilohWarrior
Senior Programmer
****
Posts: 289

shilohwarrio12
View Profile
« on: 01/18/03, 23:49 »

I was wondering what action i would use to update information in mysql database using php. I tried this but it did not work:

Code:

<?php

   $Server
="";            
   $DBuser="";               
   $DBpass="";
   $Database ="";
   $Table="";
   
//Here are all the variables flash is sending to php.

   $username stripslashes($_POST[username]);
   $password stripslashes($_POST[password]);
   $name stripslashes($_POST[name]);
   $email stripslashes($_POST[email]);
   $location stripslashes($_POST[location]);
   $websitetitle stripslashes($_POST[websitetitle]);
   $websiteurl stripslashes($_POST[websiteurl]);
   $personaltext stripslashes($_POST[personaltext]);
   $pic stripslashes($_POST[pic]);
   $ownpic stripslashes($_POST[ownpic]);
   $ownpiccheck stripslashes($_POST[ownpiccheck]);

   $DBconnect mysql_connect($Server$DBuser$DBpass); 

   mysql_select_db($Database,$DBconnect);

   $Send="UPDATE INTO $Table (username, password, name, email, location, websitetitle, websiteurl, personaltext, pic, ownpic, ownpiccheck) VALUES('$username', '$password', '$name', '$email', '$location', '$websitetitle', '$websiteurl', '$personaltext', '$pic', '$ownpic', '$ownpiccheck') WHERE username = '$username'";
   mysql_query($Send,$DBconnect);

   mysql_close ($DBconnect);

   print "&Status=Update Complete. Your information has been Updated.";
?>


It wont update it. Whats wrong? Am i doing the UPDATE INTO right?
« Last Edit: 01/18/03, 23:50 by ShilohWarrior » Logged

-Ryan
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« Reply #1 on: 01/19/03, 04:57 »

Hi,

there is an INSERT INTO table which adds a new entry to your database (new submission) and there is an UPDATE table SET varname = 'value' to submit any changes to an existing record

Musicman
Logged
ShilohWarrior
Senior Programmer
****
Posts: 289

shilohwarrio12
View Profile
« Reply #2 on: 01/19/03, 19:03 »

ahhh ok thanks i wasnt sure how to update it and set it. Thanks musicman
Logged

-Ryan
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!