Pulling out doubles of a record.
Posted: Mon Feb 20, 2006 10:09 am
Hey guys,
For some reason I am pulling out two of every field of one record in my table.
Heres my PHP.
I think it has something to do with my loop but I can't figure it out. Here is my output.
1 1 Walkways Walkways Stone Stone VA VA Loudoun County Loudoun County Ashburn Ashburn Concrete Concrete Pine Hall Pine Hall Full Range Full Range Running Bond Running Bond
Thanks
For some reason I am pulling out two of every field of one record in my table.
Heres my PHP.
Code: Select all
<?php
$imgid = 1;
$imgtype = 'Walkways';
$imgcat = 'Stone';
$link = mysql_connect("mysql", "glenizett", "1phoenix");
mysql_select_db("phoenixmason");
$query = 'SELECT * FROM `images` WHERE `ImgID` = ' . $imgid . ' and `ImgType` = "' . $imgtype . '" and `ImgCat` = "' . $imgcat . '"';
$result = mysql_query($query);
while ($line = mysql_fetch_array($result))
{
foreach ($line as $value)
{
print "$value\n";
}
}
mysql_close($link);
?>1 1 Walkways Walkways Stone Stone VA VA Loudoun County Loudoun County Ashburn Ashburn Concrete Concrete Pine Hall Pine Hall Full Range Full Range Running Bond Running Bond
Thanks