MySQL-PHP / where does the value 'ja' come from?

A

Anonymous

Guest
I'm going mad!

I want to edit or delete data in my mysql-database(Internet). The variable with the value of the primary key is sent in an <input type='hidden' to the file executing the mysql-code like:
DELETE * FROM database WHERE key = 'value'
value is an auto-incrementing INT (11)
When I view the sourcecode of the file with the form, I can see <input type='hidden' name='key' value='10'>
but when I say echo $key; in the executing file...$key is 'ja' !!!
So the data will never be deleted. NOW...strange...when I run the site on my local Apache with access to the same mysql-database...EVERYTHING WORKS !!! $key is '10'
The files on my local site are the same like the webhosted ones.

Please Help...

Alex
 
Miss_Marple said:
"...value is an auto-incrementing INT (11)
When I view the sourcecode of the file with the form, I can see <input type='hidden' name='key' value='10'>
but when I say echo $key; in the executing file...$key is 'ja' !!!
So the data will never be deleted...."
Should be:
Code:
DELETE * FROM database WHERE value = '$key';
 
I tried many possible solutions:

$sql = "DELETE FROM database WHERE key = '$value'";
$sql = "DELETE FROM `database` WHERE key = '$value'";
$sql = "DELETE FROM `database` WHERE `key` = $value";
$sql = "DELETE FROM gast WHERE key = '".$value."'";

In fact, the database is 'gast', the key is 'besuch' and the value is $besuch. So it's:

$sql = "DELETE FROM gast WHERE besuch = '$besuch'";

But the same words besuch can't be the reason, because I don't even get the correct value of '10' from my:

<input type="hidden" name="besuch" value="10">

I'm run out of ideas...
 
Back
Top