Jump to content

MySQL... Not pulling?


scottrohe

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.