Jump to content

scottrohe

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

scottrohe's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a few different queries that pull from a very large database in mySQL. It was working fine for the longest time then one day it stopped working. It only pulls like 1 query per request and will not randomize anything. I have tried having it just list the database in PHP but that only pulls out a few things also. I have tried putting backup copies of the database up, that doesn't work either. Has anyone had this problem? I'm sorry its not very detailed, very hard to explain. At once it showed all 50 states like this: Arizona County, County, County... Now it will only show one county under Arizona: Arizona County, ... function randomizeCounties($fState){ $sql2 = mysql_query("SELECT * FROM ZIPCodes WHERE StateName='$fState' GROUP BY 'CountyName' ORDER BY RAND() LIMIT 3"); while ($r2=mysql_fetch_array ($sql2)) { $countyName=$r2["CountyName"]; $i ++; if($i <= "2"){ echo "<a href='?p=county-local-insurance-agent-directory&state=".$fState."&county=".$countyName."'>".$countyName."</a>, "; } else { echo "<a href='?p=county-local-insurance-agent-directory&state=".$fState."&county=".$countyName."'>".$countyName."</a> "; } } } Is what I use for that.. As I said, it was working perfectly. Then if you go into the county to pull up what cities are within that county, it will only pull 1. No matter what I try, it will only pull 1. Thanks in advance.
  2. try  [code=php:0]$to = "myname@gmail.com, yourname@gmail.com";[/code]
  3. Wow, thanks guys! I didn't create the database, didn't even know that indexing the states like that would make that big of a difference in the first place though haha; but that did it. The page now loads in around a second rather than 10+
  4. Hey guys, I have a large database of every state/county/city etc that I have a function accessing and randomizing all of the counties per state and pulling just 3.. running 50x; very long load process.. So, I've been messing around trying to figure out how to make either a popup or a div come up saying "Loading.. Please Wait". Nothing seems to work; popups come up AFTER it is done, even if I put an "onClick" on the link that takes you to the page, although that wouldn't fix the problem as some people will be comming straight from search engines.. Pretty much the same thing with java+divs. Sorry if I posted this in the wrong forum. Here is my function that I use to randomize the counties.. [code=php:0] function randomizeCounties($fState){ $sql2 = mysql_query("SELECT * FROM ZIPCodes WHERE StateName='$fState' GROUP BY 'CountyName' ORDER BY RAND() LIMIT 3"); while ($r2=mysql_fetch_array ($sql2)) {        $countyName=$r2["CountyName"]; $i ++; if($i <= "2"){  echo "<a href='?p=county-local-insurance-agent-directory&state=".$fState."&county=".$countyName."'>".$countyName."</a>, "; } else { echo "<a href='?p=county-local-insurance-agent-directory&state=".$fState."&county=".$countyName."'>".$countyName."</a> "; } } } [/code] Any ideas on howto either a) lessen load time to about 2 seconds, rather than 10... or [b]mainly[/b] b) show a "Loading.. Please Wait" message.. Any help is much appreciated, thanks for your time.
  5. or anything else then? I thought reg expressions would since you can strip tags, etc with them?
  6. Ok so i'm lost atm with regular expressions. Here's the scenario. Users submit text through a textbox, stores it in sql, then i display it on a page. I want them to be able to use HTML (to show images, bold, etc) but i dont want the images to go over a certain size.. So if someone posts a huge image, i want to resize it within the img src tag. so if they put in [code]<img src="blah.jpg">[/code] and its over X amount in width then it remakes it to [code]<img src="blah.jpg" width="20">[/code]. Hopefuly made myself clear, gotta love being sick. Thanks.
  7. Hey guys, having some trouble with my logic CAUSE I SUCKKK. Anyways, Here's what i'm trying to do. I have a Rating system (0-5 stars). I want to display the 'Top Rated Layouts' when I 'ORDER BY ranking' it works but it displays the first layouts that have been rated with 1 vote / 5 stars.. So, what I need it to do is display the actual TOP rated layouts for example.. If a layout has 3 votes, and its average ranking is still 5 stars, obviously it's better than the layout that has only 1 vote with 5 stars. I have tried 'ORDER BY (ranking*votes)' but that bumps say a layout with a average ranking of 4.80, with 3 votes to the second position above a layout that has like 2 votes with a 5.00 ranking average. What am I doing wrong in my logic (I suck at math.)? What do I order by? Thanks for your time.
  8. hmm, ive tried adding the upload code to the forms page, then having the process return as a diff url; ex: ?x=submit&added=yes... then if added = yes, try to upload the image.. but still cant get it to, it just echos the same thing 'test.gif' instead of the full dir.. any help would be much appreciated, thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.