Ok my previous script to update did not work... i fixed it (don't ask me how !)
Here :
CODE
<?php
include ('include/connect.php');
foreach($_POST as $pn => $p) {
if(empty($p))
$p = '--EMPTY--';
$p = str_replace('"', '\\"', $p);
$p = str_replace("'", "\\'", $p);
}
$sql=("UPDATE users_info SET
username='". $_POST['username'] ."',
sexe='". $_POST['sexe'] ."',
ddn='". $_POST['ddn'] ."',
taille='". $_POST['taille'] ."'
WHERE username = '$session->username' ");
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
header("Location: index.php?id=modif_cmpt");
?>
include ('include/connect.php');
foreach($_POST as $pn => $p) {
if(empty($p))
$p = '--EMPTY--';
$p = str_replace('"', '\\"', $p);
$p = str_replace("'", "\\'", $p);
}
$sql=("UPDATE users_info SET
username='". $_POST['username'] ."',
sexe='". $_POST['sexe'] ."',
ddn='". $_POST['ddn'] ."',
taille='". $_POST['taille'] ."'
WHERE username = '$session->username' ");
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
header("Location: index.php?id=modif_cmpt");
?>
I know some stuff are wrong (thanks alex) but it works... it could be better.
I want to add one feature to this script, if raw exist than update... else insert.
How do i do that... i dunno how to build it up... i could copy if i saw but just can't build.
Sorry if i am making to many freakin threads but its a whole new topic... i need help !!!!!!