Jump to content
Cnic

Nu reusesc sa compar două string-uri

Recommended Posts

Salutare,

ma chinui sa fac un script care sa imi gaseasca features pentru un produs in mod automat.

In product_lang am la descriere de exemplu:

Quote

Raza de acţiune a iluminării IR</span></span>:</TD>
<TD class="tab_value">40&nbsp;m</TD>

l-am luat copy paste si l-am pus in feature_value intr-un camp search, cand compar description cu search nu il gaseste de nici un fel

folosesc:

$get_features = "SELECT id_feature from ps_category_features WHERE categories like CONCAT('%i:','$category',';%')";
$features = mysql_query($get_features);
while ($row_feature = mysql_fetch_array($features)) {
      $id_feature = $row_feature['id_feature'];
      $get_values = "SELECT id_feature_value, search_str from ps_feature_value WHERE id_feature  = '$id_feature'";
      $values = mysql_query($get_values);
        while ($row_values = mysql_fetch_array($values)) {
                $id_value = $row_values['id_feature_value'];
                $search_str = $row_values['search_str'];
        		if (stripos($description, $search_str) !== false) {
    				echo 'gasit feature ' . $id_feature . 'cu value ' . $id_value;
				}        
        }
}

Idei?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More