You are here: Re: UPDATE and increment by 10 « PHP Programming Language « IT news, forums, messages
Re: UPDATE and increment by 10

Posted by Jerry Stuckle on 12/16/59 11:57

version2 wrote:
> I realised that before your last post :)
>
> after making that change i removed the queery where i add 15 to a
> number just to see if that query that you gave me works but
> unfortunatley it doesnt
>
> is it missing the query or something.
>
> if ($_GET["action"] == "moveup") {
>
> $muscleName=$_GET['muscleName'];
> $ID = $_GET["ID"];
>
>
> $rank = 10;
> $result1 = mysql_query("SELECT ID,position FROM
> ".DB_PREFIX."".TBL_PREFIX." ORDER BY position");
>
> while ($data = mysql_fetch_array($result1)) {
> $result2 = mysql_query("UPDATE ".DB_PREFIX."".TBL_PREFIX." SET position
> = $rank WHERE ID = {$data['ID']}");
> $rank += 10;
> }
>
> header("Location: index_exercise.php?ID=$muscleName");
> exit;
>
> }
>

But you're just putting the same values in it as previously existed, so
how would you know if it failed?

And if it does fail (mysql_query returns false), what does mysql_error()
show?

You need to do a little troubleshooting on this, also. I can't do it
all from here.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация