php - SQL Query: Incrementing by two instead of 1 -
I am trying to update one field by increasing its integer values from 1 to 1. What I'm using here:
Update functionviews ($ id) {$ sql = "Update Tweets SET tweet_views = tweet_views + 1 where tweet_key = '$ id'"; $ Result = mysql_query ($ sql) or die ("db error:". Mysql_error ()); Return result; }
However, instead of 1, I increase by 2 each time? What am I doing wrong?
Thanks
Update
Answer is SQL correct. Do you think it might be affected by the rewriting engine ??? I will ask because I'm 100% sure that it has not run twice or I do not call because there are two scripts I one which tells the function and which keeps the function! this is confusing.
Update 2
Using the debug function I get this output:
array (4) {["file"] => ; String (35) "/home/magic/public_html/dbUpdate.php" ["Line"] = & gt; Int (16) ["function"] = & gt; String (15) "myDebugFunction" ["args"] = & gt; Array (0) {}} array (4) {["file"] = & gt; String (31) "/home/magic/public_html/view.php" ["Line"] = & gt; Int (10) ["function"] = & gt; String (11) "UpdateViews" ["Args"] = & gt; Array (1) {[0] = & gt; & Amp; String (5) "7jjdd"}}
It seems that the script is being called once, but it is being updated twice ??? help! :(
From the log file, it seems that the script is being called three times ??
13:16:28 id: 4a6c9d7cf38016.29304000 _SERVER [ REQUEST_URI] = / Lucic _SERVER [Reidirect] = / Lucic /home/magic/public_html/dbUpdate.php@16: myDebugFunction /home/magic/public_html/view.php@10: updateViews 13:16:30 ID: 4a6c9d7eaf93e3.88114161 _SERVER [REQUEST_URI] = / Lucic _SERVER [Riedirect] = / Lucic /home/magic/public_html/dbUpdate.php@16: myDebugFunction /home/magic/public_html/view.php@10: updateViews 13:16:31 ID: 4a6c9d7f846557 .12618673 _SERVER [REQUEST_URI] = / Lucic _SERVER [Riedirect] = / Lucic /home/magic/public_html/dbUpdate.php@16: myDebugFunction /home/magic/public_html/view.php@10: updateViews
Update 3
Here is a The problem is that the content of your htaccess file can be generated.
# RewriteEngine RewriteBase / RewriteCond% at {HTTP_HOST} ^ Www.messite.com com $ [nc] rewritable ^ ( . *) $ Http://mysite.com/$1 [R = 301, L] # /view.php?t=h5k6 External / h5k6 RewriteCond% {THE_REQUEST} ^ Received \ /view.php RewriteCond% {QUERY_STRING} ^ ([^ & Amp;;] * & amp;) * T = ([^ & Amp;] +) & amp;? * $ Rev. Rev. ^ See \ .php $ /% 2? [L, R = 301] # / h5k6 Internal /view.php?t=h5k6 RewriteRule ^ ([0- 9a-z] +) $ view.php? T = $ 1 [L]
You want to include the HTML of the resulting page here You can. Its possible a script, link (CSS) or IMG tag are not formatted properly, and just "", "#" or "?" Being rewritten due to being able to 'solve' the same url. If you are not doing full pathging of all URLs (/images/header.gif, etc. instead of images / header.gif), then some of these may fall through, especially when those small URL directories Try to make a request in curls (just a simple GET), and see what happens there.
Along with this, turn on HTTP access and rewrite the log-in and what is happening at that level (Note, you have to enter revitalog instructions in compiled configurations, Do not work in .htaccess) If unsuccessful, to see the actual requests, look at the request in something like Tarpada, or better than that, VirusHark.
To think about other things: Multivizzes can be caught by a suffix extension in your Apache Confirmation and it can be freely captured by your rewriting (Not sure how, but who knows) - And your rewriting log will show that Mod_dir might be trying to add a trailing slash (because those look like directories like those short URLs), though, you probably want to see it .
Comments
Post a Comment