PhP News Delete Script / My SQL Fehler?

Dieses Thema im Forum "Webentwicklung" wurde erstellt von [:v!r:]fla$h0r--, 17. Januar 2007 .

Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 17. Januar 2007
    Hallo Leute und zwar habe ich folgendes problem:

    Wenn ich News Schreiben möchte und die datei dafür aufrufe wird alles angezeigt!
    Duch Includes eingeteilt in: News schreiben und News löschen, beide formulare werden richtig dargestellt.

    Wenn ich jetzt News schreibe und abschicke wird das zwar auch gemacht, es kommt aber trotzdem folgender fehler:

    PHP:
    Warning mysql_query () [function. mysql - query ]:  Can 't connect to local MySQL server through socket ' / tmp / mysql . sock ' (2) in /usr/export/www/hosting/emuhx89/upload/script/home/del_news.php on line 26

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /usr/export/www/hosting/emuhx89/upload/script/home/del_news.php on line 26

    Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /usr/export/www/hosting/emuhx89/upload/script/home/del_news.php on line 27

    Warning: mysql_close(): 7 is not a valid MySQL-Link resource in /usr/export/www/hosting/emuhx89/upload/script/home/del_news.php on line 43
    Der selbe Fehler kommt auch wenn ich ne news wieder lösche. Die Aktion wird zwar ausgeführt aber der fehler nervt...


    Hier ist noch meine del_news datei:

    PHP:
    <? php  require( 'secure.php' ); ?>
    <?
    $status 
    $_POST [ 'status' ];
        if(
    $status  ==  "Delete"  ) {
            
    $eintrag  "DELETE FROM news WHERE id = '" . $_POST [ 'id' ]. "'" ;
            
    $eintragen  mysql_query ( $eintrag );
            
    mysql_close ( $connect );
            echo 
    '<html>
    <head>
    <link rel="stylesheet" type="text/css" href="../../source/style.css"> 
    </head>
    <body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" style="background-image: url(../../image/image24.jpg);
     background-attachment:fixed;">
    <table width="100%" height="281px" cellpadding="0" cellspacing="0">
    <tr>
    <td align="center" valign="center">
    <table class="tableop" width="200" border="2" bordercolor="#350000" cellspacing="1" cellpadding="4" style="background-image: url(../../image/background.png); filter:alpha(opacity=75);">
    <tr>
    <td align="center" width="200">News wurden gelöscht</td></tr></table></html>'
    ;
    }

    $temp [ 'PHPSELF' ] =  $_SERVER [ 'PHP_SELF' ];
    $datei  'templates/del_news_oben.htm' ;
    echo 
    template ( $temp , $datei );
        
    $abfrage  "SELECT * FROM news ORDER BY id DESC" ;
        
    $ergebnis  mysql_query ( $abfrage );
        while(
    $row  mysql_fetch_object ( $ergebnis )) {
           
    $id  $row -> id ;
           
    $titel  $row -> titel ;
           
    $bild  $row -> bild ;
           
    $autor  $row -> autor ;
           
    $thema  $row -> thema ;
           
    $datum  $row -> datum ;
           
    $temp [ 'ID' ] =  $id ;
           
    $temp [ 'TITEL' ] =  $titel ;
           
    $temp [ 'BILD' ] =  $bild ;
           
    $temp [ 'AUTOR' ] =  $autor ;
           
    $temp [ 'THEMA' ] =  $thema ;
           
    $temp [ 'DATUM' ] =  $datum ;
           
    $datei  'templates/del_news_part.htm' ;
            echo 
    template ( $temp , $datei );
            }
            
    mysql_close ( $connect );
            echo 
    gotemp ( "templates/del_news_unten.htm" );
    ?>
    Kann mir da ijemand weiterhelfen?
     
  2. 17. Januar 2007
    AW: PhP News Delete Script / My SQL Fehler?

    hi,

    schaue dir mal diese 2 links an:
    MySQL :: MySQL 5.0 Reference Manual :: C.5.2.2 Cant connect to [local] MySQL server und
    MySQL :: MySQL 5.0 Reference Manual :: C.5.4.5 How to Protect or Change the MySQL Unix Socket File

    hast du als os linux???

    nice day!!!
     
  3. 17. Januar 2007
    AW: PhP News Delete Script / My SQL Fehler?

    ahso also liegts am bertriebssystem auffem server? krieg ichd as denn trotzdem weg?

    kA welches Betriebssystem das ist bin bei ohost angemeldet

    danke schonmal für deine hilfe bw hast du^^
     
  4. 17. Januar 2007
    AW: PhP News Delete Script / My SQL Fehler?

    PHP:
    <? php
    require( 'secure.php' );

    $status  $_POST [ 'status' ];
        if(
    $status  ==  "Delete"  ) {
            
    $eintrag  "DELETE FROM news WHERE id = '" . $_POST [ 'id' ]. "'" ;
            
    $eintragen  mysql_query ( $eintrag );
            echo 
    '<html>
    <head>
    <link rel="stylesheet" type="text/css" href="../../source/style.css">
    </head>
    <body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" style="background-image: url(../../image/image24.jpg);
     background-attachment:fixed;">
    <table width="100%" height="281px" cellpadding="0" cellspacing="0">
    <tr>
    <td align="center" valign="center">
    <table class="tableop" width="200" border="2" bordercolor="#350000" cellspacing="1" cellpadding="4" style="background-image: url(../../image/background.png); filter:alpha(opacity=75);">
    <tr>
    <td align="center" width="200">News wurden gelöscht</td></tr></table></html>'
    ;
    }

    $temp [ 'PHPSELF' ] =  $_SERVER [ 'PHP_SELF' ];
    $datei  'templates/del_news_oben.htm' ;
    echo 
    template ( $temp , $datei );
        
    $abfrage  "SELECT * FROM news ORDER BY id DESC" ;
        
    $ergebnis  mysql_query ( $abfrage );
        while(
    $row  mysql_fetch_array ( $ergebnis )) {
           
    $id  $row -> id ;
           
    $titel  $row -> titel ;
           
    $bild  $row -> bild ;
           
    $autor  $row -> autor ;
           
    $thema  $row -> thema ;
           
    $datum  $row -> datum ;
           
    $temp [ 'ID' ] =  $id ;
           
    $temp [ 'TITEL' ] =  $titel ;
           
    $temp [ 'BILD' ] =  $bild ;
           
    $temp [ 'AUTOR' ] =  $autor ;
           
    $temp [ 'THEMA' ] =  $thema ;
           
    $temp [ 'DATUM' ] =  $datum ;
           
    $datei  'templates/del_news_part.htm' ;
            echo 
    template ( $temp , $datei );
            }
            echo 
    gotemp ( "templates/del_news_unten.htm" );
    ?>
    Das sollte genau so funzen Vorrausetzung für das ganze ist natürlich das dein Server da MySQL unterstützt....
     
  5. 17. Januar 2007
    AW: PhP News Delete Script / My SQL Fehler?


    Vielen Dank für deine Hilfe, aber leider wird der fehler beim Eintragen einer neuen News dennoch angezeigt und löschen geht garnicht mehr ???... BW haste aber dennoch
     
  6. 17. Januar 2007
    AW: PhP News Delete Script / My SQL Fehler?

    hm merkwürdig da habe ich eigentlich gar nichts dran gemacht versuch ma das hier:

    PHP:
    <? php
    include( "secure.php" );

    $status  $_POST [ 'status' ];
        if(
    $status  ==  "Delete"  ) {
            
    $id = $_POST [ 'id' ];
            
    $eintrag  "DELETE FROM news WHERE id = ' $id '" ;
            
    $eintragen  mysql_query ( $eintrag );
            echo 
    '<html>
    <head>
    <link rel="stylesheet" type="text/css" href="../../source/style.css">
    </head>
    <body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" style="background-image: url(../../image/image24.jpg);
     background-attachment:fixed;">
    <table width="100%" height="281px" cellpadding="0" cellspacing="0">
    <tr>
    <td align="center" valign="center">
    <table class="tableop" width="200" border="2" bordercolor="#350000" cellspacing="1" cellpadding="4" style="background-image: url(../../image/background.png); filter:alpha(opacity=75);">
    <tr>
    <td align="center" width="200">News wurden gelöscht</td></tr></table></html>'
    ;
    }

    $temp [ 'PHPSELF' ] =  $_SERVER [ 'PHP_SELF' ];
    $datei  'templates/del_news_oben.htm' ;
    echo 
    template ( $temp , $datei );
        
    $abfrage  "SELECT * FROM news ORDER BY id DESC" ;
        
    $ergebnis  mysql_query ( $abfrage );
        while(
    $row  mysql_fetch_array ( $ergebnis )) {
           
    $id  $row -> id ;
           
    $titel  $row -> titel ;
           
    $bild  $row -> bild ;
           
    $autor  $row -> autor ;
           
    $thema  $row -> thema ;
           
    $datum  $row -> datum ;
           
    $temp [ 'ID' ] =  $id ;
           
    $temp [ 'TITEL' ] =  $titel ;
           
    $temp [ 'BILD' ] =  $bild ;
           
    $temp [ 'AUTOR' ] =  $autor ;
           
    $temp [ 'THEMA' ] =  $thema ;
           
    $temp [ 'DATUM' ] =  $datum ;
           
    $datei  'templates/del_news_part.htm' ;
            echo 
    template ( $temp , $datei );
            }
            echo 
    gotemp ( "templates/del_news_unten.htm" );
    ?>
     
  7. 17. Januar 2007
    AW: PhP News Delete Script / My SQL Fehler?

    genau dasselbe problem
    Die abfrage {ID}, {THEMA} ... etc... gehen auch ned
     
  8. 18. Januar 2007
    AW: PhP News Delete Script / My SQL Fehler?

    Was genau meinst du???

    versuche doch einfach mal ein neues skript, wo du die abfrage testes bzw., wo du uns genau zeigst, wie du dich auf den server connectest.


    nice day!!!
     
  9. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.