Fehler bei Eingabe ins Suchfeld

  • Servus :)

    bei der V2.0.11 - gebe ich einen Begriff ins Suchfeld und drücke auf Enter, entsteht folgende Fehlermeldung:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/htdocs/w00d9ec9/commerce_seo_url.php on line 40

    Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w00d9ec9/commerce_seo_url.php:40) in /www/htdocs/w00d9ec9/commerce_seo_url.php on line 110

    Weiß da jemand Bescheid, wie ich das lösen kann? LG SH

  • Hallo,

    gehe mal in der File rein und lasse dir den Query ausgeben, oder anders gesagt füge vor Line 40 in commerce_seo_url.php folgende Zeile:
    echo "SELECT cn.file_name_php FROM commerce_seo_url_names AS cn JOIN commerce_seo_url_personal_links AS cp ON cp.url_text = '".mysql_escape_string($_GET['linkurl'])."' AND cn.file_name = cp.file_name LIMIT 1";

    Und sage mal was da rauskommt.

    Julien.

  • Hey Julien,

    gesag getan.

    Fehlermeldung jetzt:

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /www/htdocs/w00d9ec9/commerce_seo_url.php on line 38

  • Hmm..schreit nach Syntaxfehler kann ich aber keine in dem echo entdecken...
    Hast Du ein frisches Install? Contribs am laufen?


    ps:
    Was ist der Suchkriterium den Du angibst?
    Irgend etwas wie: o'Brian ?

  • Ok.

    Die commerce_seo_url.php wird aufgerufen weil Du die SEO url am laufen hast :)
    Hast Du unter :

    - Admin->Konfiguration->Meta&Suchmaschine->Suchmaschinenfreundliche URLs benutzen? auf true gesetz?
    - Admin->Module->cSEO MODULE->commerce:SEO URL v1 installiert und gestartet ?

    und der Cache geleert/gelöscht?

    Bei mir auf ein frisches Install funzt alles perfekt. Habe es extra nochmals getestet.

    Julien.

    ps: der o'Brian Bug ist glaube ich nirgendwo hier gelöst...man musste nachschauen wie man die ' aus dem Suchfeld parsen kann.

    Einmal editiert, zuletzt von julien (22. März 2011 um 09:57)

  • Jepp, alles gemacht - und trotzdem die Meldung

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/htdocs/w00d9ec9/commerce_seo_url.php on line 40

    Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w00d9ec9/commerce_seo_url.php:40) in /www/htdocs/w00d9ec9/commerce_seo_url.php on line 110


    Ich meine mich erinnern zu können, dass ich das Problem schon mal hatte - ich komme einfach nicht drauf, wie ich es gelöst hatte...

  • ich pinsel jetzt hier mal die commerce_seo_url.php, ich entdecke da keinen Fehler (ist ja die Originale aus dem Paket):

    <?php
    /*
    $Id: commerce_seo_url.php 2 2011-02-17 13:35:25Z akausch $

    Copyright - 2010 - Daniel Siekiera

    commerce:SEO - ein Projekt von webdesign-erfurt.de

    */

    if (file_exists('includes/local/configure.php')) {
    include ('includes/local/configure.php');
    } elseif(file_exists('includes/configure.php')) {
    include ('includes/configure.php');
    } else {
    header('Location: installer/');
    exit;
    }
    if(COMMERCE_SEO_INSTALLED != 'true') {
    header('Location: installer/');
    exit;
    }

    if(!empty($_GET['linkurl']) || !empty($_GET['manu']) && empty($_GET['error'])) {
    $connect = mysql_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD);
    mysql_select_db(DB_DATABASE);
    $data_query = mysql_query(" SELECT url_text, products_id, categories_id, blog_id, blog_cat, content_group, language_id FROM commerce_seo_url WHERE url_text = '".mysql_escape_string($_GET['linkurl'])."' LIMIT 1");
    if(mysql_num_rows($data_query) > 0)
    $data = mysql_fetch_array($data_query);
    else {
    $link_query = mysql_query("SELECT
    cn.file_name_php
    FROM
    commerce_seo_url_names AS cn
    JOIN
    commerce_seo_url_personal_links AS cp
    ON
    cp.url_text = '".mysql_escape_string($_GET['linkurl'])."'
    AND cn.file_name = cp.file_name LIMIT 1");
    if(mysql_num_rows($link_query) > 0)
    $link = mysql_fetch_array($link_query);
    }
    function get_cpath ($category) {
    $cPath = $category;
    while($category != '0') {
    $category_data = mysql_fetch_array(mysql_query(" SELECT parent_id FROM categories WHERE categories_id = '".mysql_real_escape_string($category)."' LIMIT 1"));
    if($category_data['parent_id'] != '0')
    $cPath = $category_data['parent_id'].'_'.$cPath;

    if($category_data['parent_id'] == 0)
    break;

    $category = $category_data['parent_id'];
    }
    return $cPath;
    }

    unset($_GET['linkurl']);

    if(!empty($data['products_id'])) {
    $cat_data = mysql_fetch_array(mysql_query(" SELECT categories_id FROM commerce_seo_url WHERE url_text = '".substr($data['url_text'],0,strrpos($data['url_text'],'/'))."' LIMIT 1"));
    $_GET['cPath'] = get_cpath($cat_data['categories_id']);
    if(preg_match('/_/i',$_GET['cPath']))
    $_GET['cat'] = substr($_GET['cPath'],strrpos( $_GET['cPath'], '_' )+1);
    else
    $_GET['cat'] = $_GET['cPath'];
    $_GET['products_id'] = $data['products_id'];
    if(empty($_GET['cat']) || (empty($_GET['cPath']))) {
    $getCat = mysql_fetch_array(mysql_query("SELECT categories_id FROM products_to_categories WHERE products_id = '".$data['products_id']."' "));
    $_GET['cat'] = $getCat['categories_id'];
    $_GET['cPath'] = $getCat['categories_id'];
    }
    include('product_info.php');

    } elseif(!empty($data['categories_id'])) {
    $_GET['cPath'] = get_cpath($data['categories_id']);
    if(preg_match('/_/i',$_GET['cPath']))
    $_GET['cat'] = substr($_GET['cPath'],strrpos( $_GET['cPath'], '_' )+1);
    else
    $_GET['cat'] = $_GET['cPath'];
    include('index.php');

    } elseif (!empty($data['content_group'])) {
    $_GET['coID'] = $data['content_group'];
    include('shop_content.php');

    } elseif (!empty($data['blog_id'])) {
    $_GET['blog_item'] = $data['blog_id'];
    include('blog.php');

    } elseif (!empty($data['blog_cat'])) {
    $_GET['blog_cat'] = $data['blog_cat'];
    include('blog.php');

    } elseif ((!empty($data['url_text'])) && (!empty($data['language_id'])))
    include('index.php');

    elseif(!empty($link['file_name_php'])) {
    $aktuelle_datei = $link['file_name_php'];
    $_SESSION['this_page'] = $link['file_name_php'];
    include($link['file_name_php']);
    }

    elseif (!empty($mf_data['manufacturers_id'])) {
    $_GET['manufacturers_id'] = $mf_data['manufacturers_id'];
    include('index.php');
    }

    else
    header('Location: '.HTTP_SERVER.DIR_WS_CATALOG.'404.php?error=404');

    } elseif(!empty($_GET['error']))
    header('Location: '.HTTP_SERVER.DIR_WS_CATALOG.'404.php?error=404');

    else
    include('index.php');

    ?>

  • Welches paket welches version?

    Wirklich alles in neues versionen, 100% ftp gelungen daten transfer?

    Auch den Template weil den smarty products_view_as.html und productlistings und mehr gehören dazu

  • Wie meinen? Ich habe auch schon die commerce_seo_url nach Leerzeichen oder so durchsucht (rutscht ja manchmal eins rein...) Nix... Ich bekomme den Fehler nicht weg...