scottrohe Posted July 22, 2007 Share Posted July 22, 2007 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. Link to comment https://forums.phpfreaks.com/topic/61272-mysql-not-pulling/ Share on other sites More sharing options...
scottrohe Posted July 23, 2007 Author Share Posted July 23, 2007 bump Link to comment https://forums.phpfreaks.com/topic/61272-mysql-not-pulling/#findComment-305619 Share on other sites More sharing options...
soycharliente Posted July 23, 2007 Share Posted July 23, 2007 Try using this: <?php $q = "SELECT DISTINCT CountyName FROM ZIPCodes WHERE StateName='$fState' ORDER BY RAND() LIMIT 3"; ?> Link to comment https://forums.phpfreaks.com/topic/61272-mysql-not-pulling/#findComment-305676 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.