Re: Can a range be passed to a query?

From: Date: Fri, 31 Jul 2009 21:55:07 +0000
Subject: Re: Can a range be passed to a query?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-296150@lists.php.net to get a copy of this message
On Jul 31, 2009, at 5:24 PM, "Miller, Terion" <tmiller@springfi.gannett.com
wrote:
I'm still struggling with using ranges... Can they be passed to a query somehow... I have this so far but it pulls nothing:
    //Show all  with $letter  not between "A" and "Z"
if ($ $result = mysql_query($sql) or die(mysql_error()); } while($row = mysql_fetch_assoc($result)){ $name = $row['name']; printf( '<a href="view.php?ID=%s"><b>%s</b><br />%s<br /><br /></a>', $row['ID'], $row['name'], $row['address'] ); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
What about
selectedLetter = "#") {
                              $other = range('0','9');
$sql = "SELECT DISTINCT ID, name, address FROM restaurants WHERE left(name, 1) between 0 and 9";
Bastien Sent from my iPod

« previous php.general (#296150) next »