Jump to content
php.lv forumi

UPDATE


ziedinjsh

Recommended Posts

šāds ir kods:

<?php
include "misc/config.php";
include "header.php";
include "left.php";


if (isset($_POST['edit'])) {

$username = strip_tags($_POST['username']);
$email = strip_tags($_POST['email']);

$query = mysql_query("UPDAET users SET username='$username',email='$email' ");

die("Profile is change");


}

$result = mysql_query("SELECT * FROM users WHERE ID = '{$_SESSION['user_ID']}'");

while($data = mysql_fetch_array($result))
 {


echo "<form method='post' action='".$_SERVER['PHP_SELF']."'>";

echo "<input type='text' name='username' value='".$data['username']."'><br>";

echo "<input type='text' name='email' value='".$data['email']."'><br>";

echo "<input type='submit' name='edit' value='Edit profile'>";

echo "</form>";



}



include "footer.php";

?>

 

nospiežo pugu.. parāds ziņa profile is change, bet izmaiņas nenotiek

Link to comment
Share on other sites

Paldies, es saprtu kurir vaina!

1. Kļūdaini uzrakstīju UPDATE

2. pieliku vēl klāt, lai updeto tikai lietotājam kurš ielogojies.

 

$query = mysql_query("UPDATE users SET username='$username',email='$email' WHERE ID = '{$_SESSION['user_ID']}'");

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...