Jump to content

SQL field update


asgsoft

Recommended Posts

I have this PHP script:

[code]
<?php
include 'config.php';
mysql_connect("$host", "$user", "$pass") or die(mysql_error());
mysql_select_db("$dbname") or die(mysql_error());

$outurl = $_GET['url'];
mysql_query("UPDATE `banner` SET `clicks` = (clicks+1) WHERE `link` = '$outurl'");

header("Location: $outurl");
?> [/code]

It works on Localhost and also my sites phpmyadmin when I put values instead of the variables but when I try if from the site it doesn't update the table but it stays 0.

How can I fix that?
Link to comment
https://forums.phpfreaks.com/topic/8976-sql-field-update/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.