Du befindest Dich im Archiv vom ABAKUS Online Marketing Forum. Hier kannst Du Dich für das Forum mit den aktuellen Beiträgen registrieren.

1&1 sperrt Datenbank kurzfristig

Hier können Sie Ihre Fragen zum Thema Suchmaschinenoptimierung (SEO) / Positionierung stellen
nicknolte1253
PostRank 2
PostRank 2
Beiträge: 43
Registriert: 12.12.2006, 00:05

Beitrag von nicknolte1253 » 01.06.2007, 16:59

Code: Alles auswählen

#
# Tabellenstruktur für Tabelle `_links_links`
#

mysql_query("CREATE TABLE " . $GLOBALS['prefix'] . "_links_links (
  lid int(11) NOT NULL auto_increment,
  cid int(11) NOT NULL default '0',
  sid int(11) NOT NULL default '0',
  title varchar(100) NOT NULL default '',
  url varchar(100) NOT NULL default '',
  adsaff varchar(100) NOT NULL default '',  
  description text NOT NULL,
  date datetime default NULL,
  name varchar(100) NOT NULL default '',
  email varchar(100) NOT NULL default '',
  address varchar(100) NOT NULL default '',
  hits int(11) NOT NULL default '0',
  submitter varchar(60) NOT NULL default '',
  linkratingsummary double(6,4) NOT NULL default '0.0000',
  totalvotes int(11) NOT NULL default '0',
  totalcomments int(11) NOT NULL default '0',
  length varchar(20) NOT NULL default '',
  reciprocal varchar(100) NOT NULL default '',
  PRIMARY KEY  (lid)
) TYPE=MyISAM");


function index() {
		
    $result = sql_query("select cid, title, cdescription, topicimage from ".$GLOBALS['prefix']."_links_categories where parentid='0' order by title", $GLOBALS['dbi']);
    $count = 0;
    while(list($cid, $title, $cdescription, $topicimage) = sql_fetch_row($result, $GLOBALS['dbi'])) {
        $cid = intval($cid);
	    $title = stripslashes($title); 
	    $cdescription = stripslashes($cdescription);      
       
        $cresult = sql_query("select * from ".$GLOBALS['prefix']."_links_links where cid='$cid'", $GLOBALS['dbi']);
        $cnumrows = sql_num_rows($cresult, $GLOBALS['dbi']);
        
		# Hauptüberschriften der Kategorien
		
        $keyword = seotitle($title);
        
        $titleseo1 = $keyword[0];                                        
        $titleseo2 = $keyword[1];
    
     $abstand = " ";
				
      if ($topicimage != "_blank.gif") {
        echo "<td>$abstand<font class=\"option\"><strong><big><img src=\"images/links/$topicimage\" alt=\"$title\"></big></strong> <a href=\"modules.php?name=Web_Links&l_op=viewlink&dummy1=$titleseo1&dummy2=$titleseo2&cid=$cid\"><b>$title</b></a></font>"; categorynewlinkgraphic&#40;$cid&#41;;
      &#125; else &#123;
        echo "<td>$abstand<font class=\"option\"></strong> <a href=\"modules.php?name=Web_Links&l_op=viewlink&dummy1=$titleseo1&dummy2=$titleseo2&cid=$cid\"><b>$title</b></a></font>"; categorynewlinkgraphic&#40;$cid&#41;;
      &#125;
        
        
        $titelmehr = $cid;
  						
            echo "<br>"; 
   
        $result2 = sql_query&#40;"select cid, title from ".$GLOBALS&#91;'prefix'&#93;."_links_categories where parentid='$cid' order by title limit 0, ".$GLOBALS&#91;'lihau'&#93;."", $GLOBALS&#91;'dbi'&#93;&#41;;
        $space = 0;
        while&#40;list&#40;$cid, $stitle&#41; = sql_fetch_row&#40;$result2, $GLOBALS&#91;'dbi'&#93;&#41;&#41; &#123;
            $cid = intval&#40;$cid&#41;;
            $stitle = stripslashes&#40;$stitle&#41;; 
            
        $keyword = seotitle&#40;$stitle&#41;;
        if &#40;empty&#40;$keyword&#91;0&#93;&#41;&#41; &#123; $keyword&#91;0&#93;="";&#125;
        if &#40;empty&#40;$keyword&#91;1&#93;&#41;&#41; &#123; $keyword&#91;1&#93;="";&#125;
        $titleseo3 = $keyword&#91;0&#93;;                                        
        $titleseo4 = $keyword&#91;1&#93;;
                    
                if &#40;$space>0&#41; &#123;
           
            &#125;
            $cresult2 = sql_query&#40;"select * from ".$GLOBALS&#91;'prefix'&#93;."_links_links where cid='$cid'", $GLOBALS&#91;'dbi'&#93;&#41;;
            $cnumrows2 = sql_num_rows&#40;$cresult2, $GLOBALS&#91;'dbi'&#93;&#41;;
            
            
            echo "$abstand<font class=\"content\"><a href=\"modules.php?name=Web_Links&l_op=viewlink&dummy1=$titleseo1&dummy2=$titleseo2&dummy3=$titleseo3&dummy4=$titleseo4&cid=$cid\">$stitle</a> &#40;$cnumrows2&#41;</font><br>";
 
 
            $space++;
       &#125;  
          echo "$abstand<a title=\"$title\" target=\"_self\" href=\"modules.php?name=Web_Links&l_op=viewlink&dummy1=$titleseo1&dummy2=$titleseo2&cid=$titelmehr\">"._READMORE."</a>";
 
        if &#40;$count<1&#41; &#123;
            echo "</td><td></td>";
            $dum = 1; 
        &#125;
        
         if &#40;$count>=1&#41; &#123;
            echo "</td><td>$abstand</td>";
            $dum = 1; 
        &#125;
        
        if &#40;$count==$GLOBALS&#91;'perrow'&#93;&#41; &#123;
            echo "</td><td>$abstand</td>";
            $dum = 1; 
        &#125;
        
        
        $count++;
        if &#40;$count == $GLOBALS&#91;'perrow'&#93;&#41; &#123;             # Spalteneinteilung 
            echo "</tr><tr>";
            $count = 0;
            $dum = 0; 
        &#125;
    &#125;
    if &#40;$dum == 1&#41; &#123;
        echo "</tr></table>";
    &#125; elseif &#40;$dum == 0&#41; &#123;
        echo "<td></td></tr></table>";
    &#125;
       
    
   &#125;

@net(t)worker so sieht die function für die startseite aus. Wenn ich kein Administrator bin sinds 99 Abfragen

Anzeige von ABAKUS

von Anzeige von ABAKUS »


Hochwertiger Linkaufbau bei ABAKUS:
  • Google-konformer Linkaufbau
  • nachhaltiges Ranking
  • Linkbuilding Angebote zu fairen Preisen
  • internationale Backlinks
Wir bieten Beratung und Umsetzung.
Jetzt anfragen: 0511 / 300325-0

Anonymous

Beitrag von Anonymous » 02.06.2007, 03:31

du hast nicht genug keys...

du hast 1 key den primary key: PRIMARY KEY (lid)

aber in der where clausel sehe ich dann ein

$cresult = sql_query("select * from ".$GLOBALS['prefix']."_links_links where cid='$cid'", $GLOBALS['dbi']);


für cid existiert aber kein key, d.h. diese Abfrage dauert unnötig lange...


und das meinte ich mit den keys für die felder in den where clauseln... wie gesagt, am besten für jedes Feld das in einer where clausel auftaucht einen key anlegen...

nicknolte1253
PostRank 2
PostRank 2
Beiträge: 43
Registriert: 12.12.2006, 00:05

Beitrag von nicknolte1253 » 02.06.2007, 09:12

für cid existiert aber kein key, d.h. diese Abfrage dauert unnötig lange...
@net(t)worker, danke für Deinen sehr guten Tip. Heisst das jetzt, dass es folgendermassen aussehen muss? Also einfach die Keys noch dranhängen?

Code: Alles auswählen

# 
# Tabellenstruktur für Tabelle `_links_links` 
#
...
  PRIMARY KEY  &#40;lid&#41; 
  PRIMARY KEY  &#40;cid&#41;
&#41; TYPE=MyISAM"&#41;; 

Ganz allgemein gefragt: sollte dann zu jeder where Abfrage ein Primary key vorhanden sein um die Geschwindigkeit zu erhöhen?