Current location: Hot Scripts Forums » Programming Languages » PHP » Quick Question...


Quick Question...

Reply
  #1 (permalink)  
Old 12-02-04, 10:12 AM
nuzzle nuzzle is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 26
Thanks: 0
Thanked 4 Times in 4 Posts
Quick Question...

Im trying to alphabetize the dropdown menu at my site. The database is setup to show a-y but for somereason its only showing that way when im veiwing the database in phpmyadmin. When I go to the output file :
http://www.prayershares.com/briens/search.php
it dont show in order. I dont know what kinda funky *** order its in!?
Anyone know how to organize these options? Another script maybe? or possibly javascript???

Thanks,
Keith
Reply With Quote
  #2 (permalink)  
Old 12-02-04, 10:15 AM
nuzzle nuzzle is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 26
Thanks: 0
Thanked 4 Times in 4 Posts
the code in the search.php file

Code:
<!--S:Search-->
<script language="JAVAScript" >
	function Model(newmodel) {

		var models = new Array();

		{SCRIPT}


		for (var i = document.forms[0].model.options.length ; i >= 0 ; i--)
			document.forms[0].model.options[i] = null;

		if (newmodel == "" )
			return "";
		//adding the new values;

		for (var i = 1 ; i < models[newmodel].length ; i++)
			document.forms[0].model.options[i-1] = models[newmodel][i];


	}
</script>

<form action="search.php" method="get">
<table align="center">
	<tr>
		<td>Make & Model</td>
		<td>{MAKE} & {MODEL}</td>
	<tr>
		<td>Price range:</td>
		<td>From: $<input type="text" name="pf" value="{PF}" size="5">
			To: $<input type="text" name="pt" value="{PT}" size="5">
		</td>
	</tr>
	<tr>
		<td>Year range:</td>
		<td>From: <input type="text" name="yf" value="{YF}" size="5">
			To: <input type="text" name="yt" value="{YT}" size="5">
		</td>
	</tr>
	<tr>
		<td align=center colspan=2><input type="submit"></td>
	</tr>
</table>
</form>
<!--E:Search-->

<!--S:Select-->
	<select name="{NAME}" onchange="{ONCHANGE}">
		<option value="">[ select ]</option>
		{OPTIONS}
	</select>
<!--E:Select-->

<!--S:SelectOption-->
		<option {SELECTED} value="{VALUE}">{NAME}</option>
<!--E:SelectOption-->
Reply With Quote
  #3 (permalink)  
Old 12-02-04, 10:16 AM
ArksI's Avatar
ArksI ArksI is offline
Newbie Coder
 
Join Date: Mar 2004
Location: Bulgaria
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
well if you take the info from a DB then ORDER BY will do!
Reply With Quote
  #4 (permalink)  
Old 12-02-04, 10:18 AM
nuzzle nuzzle is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 26
Thanks: 0
Thanked 4 Times in 4 Posts
I tried that, but like I said it only is ordered in the database while im veiwing it... When I close out the database, and then go to the site... its not ordered!
Reply With Quote
  #5 (permalink)  
Old 12-02-04, 10:20 AM
ArksI's Avatar
ArksI ArksI is offline
Newbie Coder
 
Join Date: Mar 2004
Location: Bulgaria
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
post here the query from the site, ok?
Reply With Quote
  #6 (permalink)  
Old 12-02-04, 10:29 AM
nuzzle nuzzle is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 26
Thanks: 0
Thanked 4 Times in 4 Posts
i did that already but here it is again...
Code:
SELECT * 
FROM `site_make` 
LIMIT 0 , 30
then I change it to:
Code:
SELECT *  FROM `site_make`  ORDER BY `make_name` ASC
But when I click go, it changes... but dont seem to save, cause when i go into another table and come back, its back to the way it was...
Does it matter that a .sql file was ran for this database? im hoping not, cause i dont know where to make the change, i've been looking but see nothing!
Reply With Quote
  #7 (permalink)  
Old 12-02-04, 10:40 AM
nuzzle nuzzle is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 26
Thanks: 0
Thanked 4 Times in 4 Posts
[B]I FIGURED IT OUT!! LoL finally... grr that was aggrivating! I had to edit that in "operations" not where I was... So its working now, thanks a bunch!!....... Guess now im on to the next problem of trying to edit this free script I d/l'ed and try to make another "catagory" ie New and Used.... or finding a way to link to them... owell.... thanks though
Reply With Quote
  #8 (permalink)  
Old 12-02-04, 12:15 PM
ArksI's Avatar
ArksI ArksI is offline
Newbie Coder
 
Join Date: Mar 2004
Location: Bulgaria
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
u r welcome
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A quick Question jbsniff PHP 8 10-12-04 09:44 AM
Quick question about while() statements Squid44th PHP 2 06-07-04 03:55 AM
Quick simple question... FugitiveMind PHP 1 04-16-04 01:53 AM
Quick Question for you php guru's Tokahashi PHP 3 04-09-04 12:00 PM
Quick Question AzWildcats81 PHP 1 11-29-03 12:42 AM


All times are GMT -5. The time now is 05:17 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.