asgsoft Posted May 3, 2006 Share Posted May 3, 2006 I have this PHP script:[code]<?phpinclude '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? Quote Link to comment Share on other sites More sharing options...
.josh Posted May 3, 2006 Share Posted May 3, 2006 when you put values instead of variables for what? Quote Link to comment Share on other sites More sharing options...
asgsoft Posted May 3, 2006 Author Share Posted May 3, 2006 sorry forgot to mention I was changing the variables of the SQL query. Quote Link to comment Share on other sites More sharing options...
.josh Posted May 3, 2006 Share Posted May 3, 2006 give an example of what you are trying to do. mysql_query("UPDATE `banner` SET `clicks` = '10' WHERE `link` = '$outurl'");would set clicks to 10, for instance. Quote Link to comment Share on other sites More sharing options...
ober Posted May 3, 2006 Share Posted May 3, 2006 When you say it works on your localhost, you mean it works without the variables or with them?What is the difference in versions between your development version and the main server version where it fails? Quote Link to comment Share on other sites More sharing options...
asgsoft Posted May 3, 2006 Author Share Posted May 3, 2006 On localhost it works with variables.On the server it works on phpmyadminMy localhost server has version 5.0.18-nt and webhosting server has version 4.1.18-standard-log Quote Link to comment Share on other sites More sharing options...
philo23 Posted May 3, 2006 Share Posted May 3, 2006 if the script is running on your localhost and not aswell then try changing the localhost variable to the mysql host of your server, ask your server admin if you dont know the host. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.