Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Need tutorial

  1. #1
    Join Date
    May 2007
    Posts
    141
    Tokens
    0

    Default Need tutorial

    On [IMG]file:///C:/DOCUME%7E1/Ryan-/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG] [IMG]file:///C:/DOCUME%7E1/Ryan-/LOCALS%7E1/Temp/moz-screenshot-1.jpg[/IMG] how to delete several rows on a mysql database using checkboxes, so you check loads of differant rows and it deletes them all.

    Ty

  2. #2
    Join Date
    Jan 2006
    Location
    Cambridge
    Posts
    1,911
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Spec View Post
    On [IMG]file:///C:/DOCUME%7E1/Ryan-/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG] [IMG]file:///C:/DOCUME%7E1/Ryan-/LOCALS%7E1/Temp/moz-screenshot-1.jpg[/IMG] how to delete several rows on a mysql database using checkboxes, so you check loads of differant rows and it deletes them all.

    Ty
    lol we cant see files on your pc :rolleyes:


    www.uploadz.co.uk it.
    EDTALKING


  3. #3
    Join Date
    May 2007
    Posts
    141
    Tokens
    0

    Default

    there ain't a screeny there i dont have a clue why thats there..

    Just read the text

  4. #4
    Join Date
    Jul 2006
    Location
    Athens
    Posts
    842
    Tokens
    0

    Default

    PHP Code:
    <?php
    $host 
    "localhost";
    $username "username";
    $password "password";
    $database "database";
    $connect mysql_connect($host$username$password);
    $select_db mysql_select_db($database$connect);

    if(
    $_GET["action"] == "delete") {
    $id $_POST["id"];
    mysql_query("DELETE FROM `table` WHERE `id` = '$id'") or die (mysql_error());
    echo 
    "$id Deleted";
    } else {
    $query mysql_query("SELECT * FROM `table`") or die (mysql_error());
    while (
    $view mysql_fetch_array($query)) {
    ?>
    <input name="checkbox" type="checkbox" value="<?php echo "{$view["id"]}"?>" /><?php echo "{$view["text"]}"?>
    <?php
    }
    ?>
    <input type="submit" value="Delete">
    <?php
    }
    ?>
    Something like that, Have a Play


  5. #5
    Join Date
    May 2007
    Posts
    141
    Tokens
    0

    Default

    Im not really sure thats what im looking for

    Basically says theres a page while'ing out a database of users, theres 5 users in the database it looks like this:

    Bob
    Ryan
    Mark
    Tom
    Dan

    Basically i want each name to have a checkbox next to it, and when you click "Delete Checked" button it goes to a page then deletes all the people that were checked from the database.

  6. #6
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    So your looking for a script not a tutorial.
    James


    Connected to reality through a proxy server.

  7. #7
    Join Date
    May 2007
    Posts
    141
    Tokens
    0

    Default

    Anything will do

  8. #8
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    Quote Originally Posted by Reina View Post
    PHP Code:
    <?php
    $host 
    "localhost";
    $username "username";
    $password "password";
    $database "database";
    $connect mysql_connect($host$username$password);
    $select_db mysql_select_db($database$connect);

    if(
    $_GET["action"] == "delete") {
    $id $_POST["id"];
    mysql_query("DELETE FROM `table` WHERE `id` = '$id'") or die (mysql_error());
    echo 
    "$id Deleted";
    } else {
    $query mysql_query("SELECT * FROM `table`") or die (mysql_error());
    while (
    $view mysql_fetch_array($query)) {
    ?>
    <input name="checkbox" type="checkbox" value="<?php echo "{$view["id"]}"?>" /><?php echo "{$view["text"]}"?>
    <?php
    }
    ?>
    <input type="submit" value="Delete">
    <?php
    }
    ?>
    Something like that, Have a Play
    There you go.
    James


    Connected to reality through a proxy server.

  9. #9
    Join Date
    Jan 2006
    Location
    Cambridge
    Posts
    1,911
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Mr Macro View Post
    There you go.
    lolz
    EDTALKING


  10. #10
    Join Date
    Jul 2006
    Location
    Athens
    Posts
    842
    Tokens
    0

    Default

    When i post scripts people seem to be oblivious to them


Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •