Reply to Re: Query Help

Your name:

Reply:


Posted by Jerry Stuckle on 11/04/07 01:26

Tom wrote:
> On Fri, 02 Nov 2007 21:12:42 -0500, Jerry Stuckle wrote...
>> jcage@lycos.com wrote:
>>> I have four fields, "name", "date", "task", and "title" - and am
>>> trying to PHP code where if I click 'All', all rows for 'Bob' followed
>>> by all rows in a MySQL datebase for 'Jim' and then all rows for 'Joe'
>>> would be displayed alphabetically (by name), with all of Bob's rows
>>> grouped together and then all of Jim's and then all of Joe's, etc
>>> (versus the way they may reside in the MySQL table).
>>>
>>> My query works well for individual names and also for 'All' but it
>>> would look and be easier to read if I could group the rows by name and
>>> maybe list alphabetically. My 'All' code portion currently looks like
>>> this:
>>>
>>> $query =
>>> "SELECT *
>>> FROM $table
>>> WHERE 1 = 1 ";
>>> if($name != "All") $query .= "and name = '".$name."'";
>>>
>>> $result = mysql_query($query);
>>>
>>>
>>> thanks for any help...
>>> John
>>>
>>>
>> You're asking about SQL, not PHP. Try comp.databases.mysql.
>>
>
>
> I get alt.php.sql on my newsgroup list, and that's helpful for SQL related
> questions too.
>
>
> Tom

But comp.databases.mysql is much better than alt.php.sql for MySQL
questions. The problem is no database implements the SQL standards 100%
or the same way. comp.databases.mysql has MySQL specific info - which,
in this case, is 100% independent of the language being used to access
MySQL, but 100% dependent on MySQL.

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

[Back to original 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

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