php MYSQL INSERT query error!
Posted: Wed Apr 01, 2009 6:49 am
hi all..
i'm generating a KEY and trying to insert it into the database, but it is not being inserted. my table has already 12 columns, i added another column "KEY" of type VARCHAR and of size 100.
the query is :
when i print the query, i can see the KEY value. but i cannot see any row filled up in my database..
can anyone please help me.. can we use WHERE clause in INSERT query?
PS: The KEY is dynamically generated, it is not coming from any other form..
i'm generating a KEY and trying to insert it into the database, but it is not being inserted. my table has already 12 columns, i added another column "KEY" of type VARCHAR and of size 100.
the query is :
Code: Select all
$key = substr(base64_encode(crypt('', '')), 0, 32);
$key = mysql_real_escape_string($key);
$query1="INSERT INTO ss_customers (key) VALUES '".$key."' WHERE customerID='".$_SESSION['customerID'] ."'";
$result1=mysql_query($query1);
echo $query1;
exit();can anyone please help me.. can we use WHERE clause in INSERT query?
PS: The KEY is dynamically generated, it is not coming from any other form..