Php > Phpmyadmin
Posted: Sat Mar 15, 2008 8:47 am
Hi all.
Here is a question about Phpmyadmin: When I send more data to my table it just make more rows, what I want is to make the data overwrite each other, so there only is one row with the newest data. I hope you can help me.
Here is a question about Phpmyadmin: When I send more data to my table it just make more rows, what I want is to make the data overwrite each other, so there only is one row with the newest data. I hope you can help me.
Code: Select all
<?php
$DBhost = "localhost";
$DBuser = "root";
$DBpass = "****************";
$DBName = "example";
$table = "details";
$_x = $_POST['Positionx'];
$_y = $_POST['Positiony'];
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sqlquery = "INSERT INTO $table VALUES('$id','$_x','$_y')";
$results = mysql_query($sqlquery);
mysql_close();
?>