You are here: Re: Error with < in SQL « PHP SQL « IT news, forums, messages
Re: Error with < in SQL

Posted by Matthew White on 09/02/07 23:05

"ZeldorBlat" <zeldorblat@gmail.com> wrote in message
news:1188769029.148282.69930@w3g2000hsg.googlegroups.com...
> On Sep 2, 4:42 pm, "Matthew White" <mgw...@msn.com> wrote:
>> I have started using the new mysql_* extensions. Here is the code I am
>> trying to run:
>> $temp2 = "SELECT * FROM assignments2 WHERE daydue < '247' &&
>> progress !=
>> '100'";
>> $temp2 = mysqli_query($mysqli,$temp2) or
>> die(mysqli_error($mysqli));
>> $temp2 = mysqli_fetch_array($temp2) or
>> die(mysqli_error($mysqli));
>>
>> This query doesn't work (though it throws no errors). Only when I change
>> the "<" to "<=" does the script work. Why doesn't the less than operator
>> work?
>
> What datatype is daydue? Why are you enclosing numbers (247 and 100)
> in quotes?
>

"daydue" is an integer. The numbers are in quotes because that's how I
usually enclose data values in SQL queries, be they numbers or otherwise.

Matt

 

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

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