Please Help me ASAP

Discussion in 'PHP' started by salayhin, Dec 28, 2009.

  1. #1
    Here Is my delete query.But I cant find where is the error caused.
    When i run this code last line showing "Song Deleted Successfully!" without any delete.

    Please help me ASAP.

    *******************************************

    $Song_id=$_GET["id"];

    $my_delete="DELETE * FROM song_detail WHERE song_ID = '$Song_id' LIMIT 1 ";

    $result=mysql_query($my_delete) or mysql_error();

    echo "<h2 align=\"center\">Song Deleted Successfully!</h2>";

    ************************

    Same Problem with my update query.
    Where is the error?

    **************************

    $singer_Id=$_GET["singer_id"];
    $singer_name=$_GET["name"];
    $singer_description=$_GET["description"];
    //$album_id=$_GET["album_name"];
    $music_category_id=$_GET["song_category"];

    /*echo $singer_Id ;
    echo $singer_name ;
    echo $singer_description ;
    echo $music_category_id ;
    */


    $my_update = "UPDATE singer_band SET
    singer_Name='$singer_name',
    description='$singer_description',
    music_category_ID='$music_category_id',
    WHERE singer_ID='$singer_Id'";

    /* $my_update = "UPDATE singer_band SET
    singer_Name='$singer_name',
    description='$singer_description',
    music_category_ID='$music_category_id',
    WHERE singer_ID='$singer_Id'";
    */

    $result=mysql_query($my_update)or die ("Could Not Run Query!");
    //$result=mysql_query($my_update) or die("Cann't Run Query!");
    echo "<h2 align=\"center\">Song Updated Successfully!</h2>";


    *******************************
     
    salayhin, Dec 28, 2009 IP
  2. CoreyPeerFly

    CoreyPeerFly Notable Member Affiliate Manager

    Messages:
    394
    Likes Received:
    24
    Best Answers:
    5
    Trophy Points:
    240
    #2
    Edit
    $Song_id=$_GET["id"];
    
    $my_delete="DELETE * FROM song_detail WHERE song_ID = '$Song_id' LIMIT 1 ";
    
    $result=mysql_query($my_delete) or mysql_error();
    
    echo "<h2 align=\"center\">Song Deleted Successfully!</h2>";
    PHP:
    to

    $Song_id = $_GET["id"];
    
    $my_delete = "DELETE FROM `song_detail` WHERE `song_ID` = '" . $Song_id . "' LIMIT 1";
    
    $result = mysql_query($my_delete) or die(mysql_error());
    
    echo "<h2 align=\"center\">Song Deleted Successfully!</h2>";
    PHP:
     
    CoreyPeerFly, Dec 28, 2009 IP
  3. salayhin

    salayhin Peon

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks For ur Reply
     
    salayhin, Dec 28, 2009 IP
  4. masterofweb

    masterofweb Greenhorn

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    only change '$Song_id' to without single quotes.
     
    masterofweb, Dec 29, 2009 IP