Re: [PHP] Changing case
On Wed, 12 Nov 2003 11:29:10 -0500, you wrote: >I have a form that allows for an item to be entered, the other pieces >have been fixed so far that were bogging me down, but now I am looking >for a way to convert any entry in the form to be UPPER case so that when >the quote is listed, they are alphabetical. > >The problem is if someone enters aa-1234 and the other items in the >quote are FF-2345 and QQ-3456 then the aa-1234 is UNDER them, instead of >on top. Rather than upper-casing all your data, how are you sorting it? I would expect your database to do a case-insensitive sort by default... SELECT column from table ORDER BY column should return abc ABC def DEF or you could use a case-insensitive sort function, eg http://www.php.net/manual/en/function.natcasesort.php (though there are others). Of course, if you want everything upper-case for consistency rather than ordering, forget everything I just said. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing case
From: "Robert Sossomon" <[EMAIL PROTECTED]> > I have a form that allows for an item to be entered, the other pieces > have been fixed so far that were bogging me down, but now I am looking > for a way to convert any entry in the form to be UPPER case so that when > the quote is listed, they are alphabetical. http://us2.php.net/strtoupper ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Changing case
[snip] The problem is if someone enters aa-1234 and the other items in the quote are FF-2345 and QQ-3456 then the aa-1234 is UNDER them, instead of on top. [/snip] http://www.php.net/strtoupper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Changing case
I have a form that allows for an item to be entered, the other pieces have been fixed so far that were bogging me down, but now I am looking for a way to convert any entry in the form to be UPPER case so that when the quote is listed, they are alphabetical. The problem is if someone enters aa-1234 and the other items in the quote are FF-2345 and QQ-3456 then the aa-1234 is UNDER them, instead of on top. / // // Store.php // / /* The following code allows for the addition of a non-stock item. All information is added automatically to the quoter for the salesman. */ $display_block .= "Input a new item: Item ID:Description:Quantity: "; $display_block .= "01"; for ($i=2; $i < 301; $i++){ $display_block .= "$i"; } $display_block .= "Price:"; / // // addspec.php // / if ($_POST[sel_item_qty] != "0") { if($_POST[sel_item_id] != "") { //add info to cart table $addtocart = "insert into store_shoppertrack values('','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]', '$_POST[sel_item_price]','$_POST[sel_item_desc]', now())"; mysql_query($addtocart); //redirect to showcart page header("Location:$_POST[url]"); exit; } else { //send them somewhere else header("Location:ohcrud.php"); exit; } } else { //print message $display_block .= "You must select a Quantity. Please continue to shop!"; } TIA!! Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php