TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
SOFARI HASSANE
NA
237
21.7k
my request php mysql can not update
Feb 24 2018 5:48 AM
<?php
include
"../conn.php"
;
if
( isset(
$_POST
[
'edite'
]) )
{
$id
=
$_GET
[
'id'
];
$code
=
$_GET
[
'code'
];
$nom
=
$_GET
[
'nom'
];
$adresse
=
$_GET
[
'adresse'
];
$query
=(
"UPDATE clients SET CodeClient= '$code',Nom='$nom',Adresse='$adresse' WHERE user_id='$id'"
)
or
die
(mysql_error());
if
(mysqli_query(
$con
,
$query
)){
echo
"Modification réussie!"
;
}
else
{
echo
"Erreur modification"
;
}
}
mysqli_close(
$con
);
?>
<?php
while
(
$row
=mysqli_fetch_assoc(
$result
)){
$code
=
$row
[
'CodeClient'
];
$nom
=
$row
[
'Nom'
];
$adresse
=
$row
[
'Adresse'
];
}
?>
<input type=
"hidden"
name=
"id"
value=
"<?php echo $row['user_id'];?>"
>
<div
class
=
"form-group"
>
<label>Code Distributeur</label>
<input type=
"text"
name=
"code"
class
=
"form-control"
value=
"<?php echo $row['CodeClient'];?>"
>
</div>
<div
class
=
"form-group"
>
<label>Nom Distributeur</label>
<input type=
"text"
name=
"nom"
class
=
"form-control"
value=
"<?php echo $row['Nom'];?>"
>
</div>
<div
class
=
"form-group"
>
<label>Adresse Distributeur</label>
<input type=
"text"
name=
"adresse"
class
=
"form-control"
value=
"<?php echo $row['Adresse'];?>"
>
</div>
<button type=
"submit"
name=
"edite"
class
=
"btn bg-success btn-block"
>Modifier</button>
<?php
?>
</form>
</div>
</body>
</html>
above my code
Reply
Answers (
3
)
How to set up radio button validation in php.
passing data from form before script get call on button