Re: [PHP] Re: stripping first comma off and everything after
http://php.net/manual/en/function.split.php I haven't tested for efficiency but splitting it will be great for assigning it easily into an array. On Fri, Jun 18, 2010 at 7:42 PM, Robert Cummings wrote: > shiplu wrote: > >> I'll use, >> >> list($data) = explode(",",$entries[$i]["dn"]); >> >> > It's probably the least efficient method. > > > Cheers, > Rob. > -- > E-Mail Disclaimer: Information contained in this message and any > attached documents is considered confidential and legally protected. > This message is intended solely for the addressee(s). Disclosure, > copying, and distribution are prohibited unless authorized. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
[PHP] php forms - select menu selected behavior
I have the code below being used to rifle through a list of available categories and create select options for them. The code is being used to query the database and compare the product category to the current iteration, if there's a match, then add selected code so the category is prechosen. More code (not included) does the saving and all that, I've check phpmyadmin. But when the page submits, the old category appears in the drop down as selected. If I leave the page and come back it's fine, it's just right after it is saved. The form script is being used on itself, in that there is only one file for the form, the submission, etc. All of the other input elements will load the data after being saved, is it something specific to dropdowns, or it is the way the code is being instatiated? All help is much appreciated. Please let me know if anymore info is needed. //MAKE CATEGORIES DROPDOWN $sql="SELECT * FROM categories ORDER BY category"; $catmatch="SELECT * FROM product WHERE dbi='$dbi'"; $catresult=mysql_query($catmatch); $catquery=mysql_fetch_array($catresult); //for($a=0;$a".$id.""; } else { $catlist1.="".$id.""; } } to instantiate