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 01-02-2013, 09:40 PM   PM User | #1
maici
New to the CF scene

 
Join Date: Jan 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
maici is an unknown quantity at this point
Could someone help me how to convert this to form action

So I have follow code. Which replace username "333" to "reer" in database.
But I'm kinda lost how to make this code working follow method:

There is field box where typing user's current username and second field where type new user's username and then just submit. If someone have time to help me I appreciate it very much.

Code:
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("database", $con);

mysql_query("UPDATE users SET username='reer'
WHERE username='333'");

mysql_close($con);
?>
maici is offline   Reply With Quote
Old 01-02-2013, 10:43 PM   PM User | #2
maici
New to the CF scene

 
Join Date: Jan 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
maici is an unknown quantity at this point
Solved :=). by myself
maici 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 05:50 AM.


Advertisement
Log in to turn off these ads.