Cita:
En la tabla hay unos registros. Yo lo que quiero hacer, es que con este código aumente el campo count (+1) del registro que yo seleccione de la tabla.<?php
//Set database to counter
$db="base de datos";
//connect to server and database
//If you need to supply a username and password, then use the following line
//of code instead of the one above, substituting the correct username and password.
$link = mysql_connect("************");
if (! $link) die("Cannot connect to MySQL");
mysql_select_db($db , $link) or die("Cannot open $db: ".mysql_error());
//Increment counter
mysql_query("UPDATE tabla SET count=count+1");
//extract count from database table
$counter = mysql_query("SELECT * FROM countertable");
//close link to MySQL server
mysql_close($link);
?>
//Set database to counter
$db="base de datos";
//connect to server and database
//If you need to supply a username and password, then use the following line
//of code instead of the one above, substituting the correct username and password.
$link = mysql_connect("************");
if (! $link) die("Cannot connect to MySQL");
mysql_select_db($db , $link) or die("Cannot open $db: ".mysql_error());
//Increment counter
mysql_query("UPDATE tabla SET count=count+1");
//extract count from database table
$counter = mysql_query("SELECT * FROM countertable");
//close link to MySQL server
mysql_close($link);
?>
Como hago para especificar el registro? creo que es algo con WHERE, no se, si me pueden ayudar explicandome o directamente darme el código modificado, gracias.
Si no me entienden avisenme