Im getting weird output with this one. Basically Im having it scavenge my database zip code field for any fields longer than 5 (the length of a zip code). A few of my zip fields have full addreses in them due to a crappy script that went through it to 'fix' them.
Now, I get this as output:
Heres my code
For the record, my zip field is text. It (should) contains zip codes. This script is to find the non-conformists.
For bonus points, can anyone recommend to me (hopefully Jon doesnt mind this) a forum where I can get more immediate PHP help? Im new to PHP coding and dont know the 'happenin spots' for php on the web. WickedFire is great and all but definitely not THE place for PHP Feel free to PM me those.
Now, I get this as output:
Code:
Fucked up entry:
Fucked up entry:
Fucked up entry:
Fucked up entry:
Resource id #5
Fucked up entry:
Resource id #6
Fucked up entry:
PHP:
<?php
include 'include.php';
$query = mysql_query("SELECT zip FROM shops");
while($array=mysql_fetch_array($query)){
// How big is it? Heh.
$length = strlen($array["zip"]);
// If its NOT length 5, then warn
if(!($length == 5)){
// Queer-y the entry
$query2 = mysql_query("SELECT zip FROM shops WHERE zip = '$array[zip]'");
// Echo out entry
echo "Fucked up entry: <br>";
echo $query2;
echo "<br><br>";
}
else{
// do nothing
}
}
?>
For bonus points, can anyone recommend to me (hopefully Jon doesnt mind this) a forum where I can get more immediate PHP help? Im new to PHP coding and dont know the 'happenin spots' for php on the web. WickedFire is great and all but definitely not THE place for PHP Feel free to PM me those.