Loop does thing once only
Posted: Mon Mar 02, 2009 1:50 pm
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Hi,
I've been banging my head all day and I can't figure it out.
It's supposed to insert all matches into table, but it only does if the first object ([0]) matches.
If it's [3] loop doesn't see it.
Please help ASAP.
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Hi,
I've been banging my head all day and I can't figure it out.
Code: Select all
$find = strip_tags($find);
$find = trim($find);
$find = strtoupper($find);
$data = mysql_query("SELECT * FROM profiles");
while ($ss1 = mysql_fetch_array( $data ))
{$ss3=$ss1['keywords']; $ss4=(explode(",",$ss3));
for ($x=0; $x<count($ss4); $x++){
$ss5=strip_tags($ss4[$x]);
$ss5=trim($ss4[$x]);
$ss5=strtoupper($ss4[$x]);
if ($find==$ss5){ $profile=$ss1['name']; $pro_lvl=$ss1['prolvl'];
$query=("insert into search(profile,pro_lvl,id) values ('$profile','$pro_lvl','$id')");
$result = mysql_query($query);
}}}It's supposed to insert all matches into table, but it only does if the first object ([0]) matches.
If it's [3] loop doesn't see it.
Please help ASAP.
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: