Jump to content


Photo

Help needed!


  • Please log in to reply
2 replies to this topic

#1 Magollo

Magollo
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 September 2006 - 08:23 PM

Hey there. Ive got a problem with PHP/Mysql. I hope somebody could help me out.

I dont know pretty well MySQL, but I built a Query and tested in phpmyadmin and it worked fine.
But when I try to ejecute the query by PHP (mysql_query() function) it seems to be wrong and gets me the 1064 error.
Don´t know whats happening. Can somebody help me please?

This is the Query :

SET @village = 1;
SET @segundos = (SELECT (( TO_DAYS( NOW() ) - 73000 ) * 86400 + TIME_TO_SEC( NOW() )) - (( TO_DAYS( `lastcheck` ) - 73000 ) * 86400 + TIME_TO_SEC( `lastcheck` )) FROM village WHERE `id` = @village);
SET @addwood = (SELECT (`addwood` * @segundos) FROM village WHERE `id` = @village);
SET @addstone= (SELECT (`addstone` * @segundos) FROM village WHERE `id` = @village);
SET @addiron = (SELECT (`addiron` * @segundos) FROM village WHERE `id` = @village);
SET @addgold= (SELECT (`addgold` * @segundos) FROM village WHERE `id` = @village);
UPDATE `village` SET wood = wood+@addwood,stone = stone+@addstone,iron = iron+@addiron,gold= gold+@addgold,lastcheck = NOW() WHERE `id` = @village;
SELECT @addwood as addwood, @addstone as addstone,@addiron as addiron,@addgold as addgold


Check it at www.magollo.com.ar/test.php

#2 cyprus

cyprus
  • Members
  • PipPipPip
  • Advanced Member
  • 68 posts

Posted 27 September 2006 - 08:49 PM

Sorry, forgive me, as its the blind leading the blind. But as nobody had come in yet, I did a google search for the error you were getting, don't know if this link is of any help. Regards

http://www.modwest.c...lp/kb6-265.html

#3 Magollo

Magollo
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 September 2006 - 09:14 PM

Thanx a lot for answer. i think that version problem would be happening. But I can´t change the compatibility.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users