Jump to content

phpboy

Member
  • Posts

    58
  • Joined

  • Last visited

Posts posted by phpboy

  1. ok... i'll try to change my updateform.html to updateform.php

    updateform.php

    <?php

    print '

    ';

    $x = $_GET['number'];

    echo '';

    print 'Number: ';

    print '';

    print '

    ';

    ?>

     

    then my updateneil2.php:

    <?php

    $conn=mysql_connect("localhost","Root","");

    mysql_select_db("library") or die("unable to connect");

    $old_number=$_POST['oldnumber'];

    $new_number=$_POST['number'];

    mysql_query("UPDATE tablelibrary SET Books='$new_number' where name='$old_number'") or die("ERROR:mysql_error());

    header("Location: updateneil.php");

    ?>

     

    I just want to have a form in every row in my updateneil.php then in that form (updateform.php) the number entered there would be updated to my updatedneil2.php and then back to the page updateneil.php..

     

    But still that isn't work out..

  2. yes bro... i have there form which a user can add/subtract number of books and go to my updateneil2.php

    the problem is my update code.. i try to delete those codes

    where Name=NAme AND Author=Author

    but still "cannot update" which means my sql query is wrong..

  3. bro, i havent finished watching those videos...

    but bro can u give me your codes in "UPDATES" for my database?

    i thing the number of books column will i just make for updates ryt?

    i have finished the registration form and now working on my search page..

    bro i am just confused how i will do it..or how to do it clearly...

    bro one more time this would be the last....

    ty again bro..

  4. bro, supposetedly my deleteben1.php is right?

    how will you make my deleteben2.php....(after accessing your php now.. ^_^)

    what will be your codes...

    database name: library

    table name : tablelibrary

    id,Books,Name,Author(columns)

    Using only the default username and password for connecting php to sql..

    after deleting of items, show directly to the deleteben.php..

    and keep on processing....

    I'll be waiting bro..go to go school right now....see you later with your codes hehe ty

  5. <?php

    $con = mysql_connect("localhost","root","");

    if (!$con)

    {

    die('Could not connect: ' . mysql_error());

    }mysql_select_db("library", $con);$sql="DELETE FROM tablelibrary WHERE (id)='$_POST[id]'";if (!mysql_query($sql,$con))

    {

    die('Error: ' . mysql_error());

    }

     

     

     

    echo "record/s deleted";

    $result = mysql_query("SELECT * FROM tablelibrary");

     

    echo "

    Name

    Author

    Number of Books

    ";while($row = mysql_fetch_array($result))

    {

    echo "

    echo "

    " . $row['Name'] . "";

    echo "

    " . $row['Author'] . "";

    echo "

    " . $row['Books'] . "";

    echo "

    ";

     

    }

     

    echo "

    ";mysql_close($con);

    ?>

  6. so my deleteben.php is right? nothing to change ryt? cause it do have a link now going to my deleteben2.php

     

    how can u make my deleteben2.php?

    out of deleteben2.php? can u post here the codes in ur mind then i'll try to do it here ^_^

    if it's working:D

  7. what i mean is:

    in ur codes:

    echo '

    delete';

    this is the link at this code

    deleteben2.php?id='

    in the 'id='

    do i have to put name there after equals?

    then in my page use the method $_GET['(name that i will put in id='']

     

    waaa can u give me ur codes pls

    codes for a form showing my supposed to be what i want... for delete page and delete.php for every 'delete' link

    ty

  8. bro...i do have nothing to change in my deleteben.php?

    i try to do it but i failed

    here's my code for deleteben2.php

    <?php

    $con = mysql_connect("localhost","root","");

    if (!$con)

    {

    die('Could not connect: ' . mysql_error());

    }mysql_select_db("library", $con);

    $sql="DELETE FROM tablelibrary WHERE (id)='$_get[id]'";

    header("location: deleteben1.php");

    ?>

     

    and probably it doesnt run correctly..

    can u give me your codes for it?? so that i can go on to my "UPDATES" page >_<

     

    another question..

    how can i use the $_GET in a link??

    i mean in using form we usually put 'names' in input types then put in our php page , $_GET['names']

  9. bro! ^_^

    i have sent u the codes u want.....

    ei i'm asking at the my deleteben.php

    there's a code there with the links to deleteben2.php

    how can i make the deleteben1.php that

    in every click of the link "delete"

    it will automatically delete the item and back again to the page

  10. <?php

    $con = mysql_connect("localhost","root","");

    if (!$con)

    {

    die('Could not connect: ' . mysql_error());

    }mysql_select_db("library", $con);$sql="DELETE FROM tablelibrary WHERE (id)='$_POST[id]'";if (!mysql_query($sql,$con))

    {

    die('Error: ' . mysql_error());

    }

     

     

    echo "record/s deleted";

    $result = mysql_query("SELECT * FROM tablelibrary");

     

    echo "

    Name

    Author

    Number of Books

    ";while($row = mysql_fetch_array($result))

    {

    echo "

    echo "

    " . $row['Name'] . "";

    echo "

    " . $row['Author'] . "";

    echo "

    " . $row['Books'] . "";

    echo "

    ";

     

    }

     

    echo "

    ";mysql_close($con);

    ?>

  11. Sir, in my theSis,

    i have done forms, Forms are for "INSERT" ," DELETE" and "UPDATE"

    Yes! i have done all completely by myself with the use of php and mysql...

    The scripts are all working..

    In "INSERT" form

    if i insert one item the inserted item will be inserted in my database and then i show the list of items in the same page so that it will act good ^_^

    The same with the other 2 forms

     

    But in "DELETE" form

    If i deleted one item that is not in my database of course the scripts will just execute as what i designed to it..

    But the real thing is that

    i want to display also that if one item is deleted or updated and that item is not found inside my database, a promt or echo will say that "the item is not in the list"

    i mean how can i do that? is there any ideas there Sir?:)

    ty in advance

×
×
  • Create New...