Re: [PHP-DB] Re: [PHP] Strange Query Error...

2010-11-27 Thread Niel Archer
 On Nov 27, 2010, at 10:08 AM, Daniel P. Brown wrote:
 
  one primary question: are you using the mysql_*
  family, mysqli_* family, or another method of interfacing with MySQL?
 
 mysql_
 
 $results = mysql_query($query) or die(mysql_error());
 
 Don
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
Could you show the actual code, not just the query. The way you are
setting up the query could be affecting it. i.e. using single quotes when
assigning to a variable would not work with your query.

--
Niel Archer
niel.archer (at) blueyonder.co.uk



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: [PHP] Strange Query Error...

2010-11-27 Thread Karl DeSaulniers


On Nov 27, 2010, at 1:24 PM, Don Wieland wrote:


On Nov 27, 2010, at 10:44 AM, Daniel P. Brown wrote:


   Note how you keep changing case here.  For example, m.aucciim_id
vs. m.AUCCIIM_ID.  Also note that all of this is cAsE-sEnSiTiVe.


You are right. But it still chokes in PHP:

select m.* from Members m inner join Member_Years my on  
m.AUCCIIM_ID = my.member_id where now()  DATE_ADD(DATE_SUB(concat 
(member_year + 1,'-07-01'), INTERVAL 1 DAY), INTERVAL 30 DAY) AND  
m.Preferred_First_Name LIKE 'Don%' group by m.AUCCIIM_ID order by  
m.preferred_last_name


Don



Don't know if you necessarily need this but I found it while checking  
to see if one letter names are a good idea in MySQL statements.

Might help in your like query.

http://techonthenet.com/sql/like.php

HTH,
Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php