How to SELECT WHERE column = string?
Posted: Sat Jan 22, 2005 1:51 pm
Code: Select all
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in *****featured.php on line 61WHERE t3.Featured = Y
returns nothing, prolly the wrong syntax, but I've used
=QUOTE(Y)
='Y'
=('Y')
I've searched about 4 different tutorial sites and forums and I can't find a solution to this simple problem! lol
Code: Select all
function getFeatured(){
Global $connection;
$today = date("Ymd");
hookUpDb();
$query = "SELECT t1.PhotoURL, t3.MemberNum, t3.ExtColor, t3.Descr1, t3.NumOfColor
FROM photos t1, xrefphotomember t2, memberinfo t3
WHERE t3.Featured = Y
AND t2.PID = t1.PID
AND t3.MID = t2.MID";
$result = mysql_query($query,$connection);
openFeaturedTable();
while ($row = mysql_fetch_row($result)){
$PhotoURL = unFormatData($rowї0]);
$MemberNum = unFormatData($rowї1]);
$ExtColor = unFormatData($rowї2]);
$Descr1 = unFormatData($rowї3]);
$NumOfColor = unFormatData($rowї4]);
print("$PhotoURL");
print("$MemberNum");
print("$ExtColor");
print("$Descr1");
print("$NumOfColor");
$PhotoLarge = $MemberNum. "-". $PhotoURL. ".jpg";
$PhotoThumb = "images/cars/". $MemberNum. "-". $PhotoURL. "-thumb.jpg";
$String1 = "Member #". $MemberNum;
$String2 = $NumOfColor. $ExtColor. "99 VR-4s";
$Build1 = "','600','451','* * Click screen to close * *','#000000','hug image','0');return document.MM_returnValue"><img src="$PhotoThumb" alt="" width="169" height="127" border="0"></a><br /><span class="featuredtext">$String1<br />$String2<br />$Descr1</span></div></td>
</tr>
</table> ";
$Output = $PhotoLarge. $Build1;
print("$Output");
}
mysql_free_result($result);
mysql_close($connection);
}