You are here: Re: Problem with my SELECT « PHP Programming Language « IT news, forums, messages
Re: Problem with my SELECT

Posted by Rik on 10/26/06 19:03

bokke wrote:
> Hey Rick,
>
> I have always used
> <a href="Contributor.php?action=&SubCat=<?php echo $row["writer"];
>> "><?php echo $row["writer"];?></a>
> to feed the variable - and then used
> $query = "SELECT * FROM news WHERE writer='$SubCat' ";
> - I only use POST and GET with forms - not simple links.
>
> -"quote strings" - not sure which string you would like me to quote?
>
> -as for
> "> - Offcourse, there's always spelling errors.
>> - Echo the query-string, to check wether the query is built correctly
>> (which it wasn't in this case).
>> - Use backticks around field- and tablenames
>> - Echo mysql_error(), and check what it sais."
>
> -Checked the spelling again and again - but thats not it
> -I use or die ("no can do."); so I know when it's not working - in
> this
> case it works just not reading the variable. Again, if I change the
> WHERE writer='$SubCat' "; to WHERE writer='Bob Smith' "; it works
> fine ???
>
> and as for "blindly post this to a newsgroup/forum" man - I am on day
> two of this problem - you can only spell writer so many ways before
> you realize it is not spelling. I think I have exchased all my tricks
> ... it must be a header issue or a .... damn i just don't know?
>


Well, it would help a lot if you:
echo $query;
echo mysql_error();

And come back to us with that.
An or die() construct is fine, but if something indeed goes wrong, one
would like to know what, not just 'something'. You could temporarily make
it or die(mysql_error()); (do not do this on production servers...).
--
Rik Wasmus

 

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

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