Page 3 of 7 FirstFirst 123456 ... LastLast
Results 25 to 36 of 84

Thread: PHP MySQL Class-20

  1. #25
    TanzeeBhayo's Avatar
    TanzeeBhayo is offline Senior Member+
    Last Online
    21st March 2011 @ 12:04 PM
    Join Date
    25 Aug 2008
    Location
    Hyderabad
    Age
    38
    Posts
    117
    Threads
    6
    Credits
    596
    Thanked
    0

    Default

    thanks you brother

  2. #26
    Join Date
    02 Mar 2009
    Location
    In Ask An Expert
    Age
    34
    Posts
    7,257
    Threads
    122
    Credits
    945
    Thanked
    297

    Default

    Thanks Shakeel Bhai

  3. #27
    goodworkisluck is offline Member
    Last Online
    24th October 2009 @ 10:09 PM
    Join Date
    05 May 2009
    Age
    32
    Posts
    833
    Threads
    33
    Thanked
    9

    Default

    bohat khoob yar
    //////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////
    ''''''''''''''''''''''''__________________________ _____________________________
    Bank me 1 achi job he
    For u
    Rs 25000 pay milay gi
    kaam sirf ye he k sara din cashier k
    samne ZUBAN
    nikal kr bethna
    wo anghotha laga ker Note gine ga
    __________________________________________________ ______________

  4. #28
    Join Date
    14 Dec 2008
    Location
    Bahawalpur
    Age
    31
    Posts
    46
    Threads
    4
    Credits
    930
    Thanked: 1

    Default

    بہت بہت اچھا لکھا ہے آپ نے
    میں کوئی ایسا ہی کورس ڈہونڈ رہا تھا
    Very Good Yar.

    shahbaz348***********
    www.bingpk.com

  5. #29
    Join Date
    14 Dec 2008
    Location
    Bahawalpur
    Age
    31
    Posts
    46
    Threads
    4
    Credits
    930
    Thanked: 1

    Default

    Shkeel Sahib Smaj Nhi Aa rhaa k kis trhaa aap ka shukria Adaa Krun
    Main Ne Is Course k tmaam Pages Computer Main Save Kr liye Hain
    Mujhy PHP aur SQL main Bohat Intrest hai
    Aure Mujhy Umeed hai k main isy Achy Treeqy sy Seekh Skta houn

    Umeed hai k aap is k baad koi aur Tutorial Shru krain gy

    Shahbaz Ashraf

    www.bingpk.com

  6. #30
    sahilomar is offline Senior Member+
    Last Online
    6th November 2012 @ 07:20 PM
    Join Date
    23 Jun 2009
    Age
    38
    Posts
    58
    Threads
    1
    Credits
    965
    Thanked
    0

    Default

    Great work

  7. #31
    jaminee is offline Senior Member+
    Last Online
    30th September 2015 @ 07:02 AM
    Join Date
    25 Mar 2009
    Location
    Mandi Bahauddin
    Age
    40
    Posts
    91
    Threads
    21
    Credits
    838
    Thanked
    0

    Default

    Nice Brother Your Great Thanks

  8. #32
    moon_6432000's Avatar
    moon_6432000 is offline Senior Member+
    Last Online
    1st January 2024 @ 08:06 AM
    Join Date
    18 Jul 2008
    Location
    Kamra, Attock
    Age
    38
    Gender
    Male
    Posts
    530
    Threads
    13
    Credits
    129
    Thanked
    25

    Default

    Shakeel Bahi ak masla hae
    man nae jo edit.php banae hae us se man delete karta hoon to delete ho jata hae magar jab edit karta hoon to edit hone k bad save nahi hota . Bas ye lika howa ajata hae(Invalid Student ID).
    mane jo lika hae wo man app ko send karta hoon app dakan k us man kiya ghalti hae.

  9. #33
    moon_6432000's Avatar
    moon_6432000 is offline Senior Member+
    Last Online
    1st January 2024 @ 08:06 AM
    Join Date
    18 Jul 2008
    Location
    Kamra, Attock
    Age
    38
    Gender
    Male
    Posts
    530
    Threads
    13
    Credits
    129
    Thanked
    25

    Default

    <?php
    //connection file
    include "connection.php";

    //getting query strings
    $sid =$_GET['sid'];
    $do = $_GET['do'];

    //what to do
    switch ($do) {
    case "edit": //if editing record, show edit form
    edit_Record_Form($sid);
    break;
    case "del": //if deleting record
    del_Record($sid);
    break;
    case "save": //if saving edited record
    save_Record();
    break;
    default;
    error_Message("Invalid Page Request");
    }
    //validating requested id
    function chkID($id) {
    $sid = intval($id);
    //if invalid
    if (empty ($sid) OR !is_int ($sid)) {
    error_Message("Invalid Student ID");
    }
    return $sid;
    }

    //edit form
    function edit_Record_Form($id) {
    //validating $id
    $sid = chkID($id);
    //query (select all record form result table associated with this $id)
    $Query = "SELECT * FROM result WHERE sid = $sid";
    //executing query
    $Result = mysql_query ($Query) or error_Message(mysql_error());
    //if no record found
    if (mysql_num_rows ($Result) <=0) {
    error_Message("No record Found");
    }

    //get return row in $Row array
    $Row = mysql_fetch_assoc ($Result);

    //print the edit form and set elements values
    //using the $Row array
    $Row = mysql_fetch_assoc ($Result);

    //print the edit form and set elenents values
    //using the $Row array
    print "<form method=\"post\"action=\"{$_SERVER['PHP_SELF']}?do=save\">
    <table border=1 cellpadding=3 cellspacing=3 width='50%'>
    <tr><th colspan=2 align='left' bgcolor='#EAEAEA'>
    Edit Result</th></tr>
    <tr><td>Student Name</td><td>
    <input type=\"text\"name=\"sName\"value=\"{$Row['sname']}\">
    </td></tr><tr><td>MARKS</td><td>
    <input type=\"text\"name=\"sMARKS\"value=\"{$Row['MARKS']}\">
    </td></tr><tr><td colspan=2 align='center'>
    <input type=\"submit\"value=\"Save\">
    <input type=\"button\"value=\"Cancle\"onClick=\"history.g o(-1);\">
    <input type=\"hidden\"value=\"{$Row['sid']}\"name=\"sid\">
    </td></tr></table></form>";

    }
    //deleting record
    function del_Record ($id) {
    $sid = chkID($id);
    //executing delete query
    if (!mysql_query("DELETE FROM result WHERE sid=$sid")) {
    error_Message("Could not delete record<br>" .mysql_error());
    }
    print "<div style='background:#FFFFCC;border:dashed 1px #CCCCCC'>
    Record Deleted Successfully<a href='new_record.php'>Continue</a></div>";
    }

    //saving record
    function save_Record() {
    //getting form values
    //note: the sid is hidden field in
    //form contains the value of sid field
    $ID = chkID($_POST['sid']);
    $Name =cleanString($_POST['sName']);
    $MARKS =(int) cleanString($_POST['sMARKS']);
    //checking for empty values
    if (empty ($Name) || empty ($MARKS)) {
    error_Message("Cannot insert empty record");
    }
    //marks range
    if ($MARKS < 0 || $MARKS > 99) {
    error_Message("Marks must be between 1 - 99");
    }
    //max student name
    if (strlen ($Name) > 40) {
    error_Measage("Name is too long");
    }
    //query for unpating record
    $query = "UPDATE result SET sname = '$Name',MARKS = $MARKS
    WHERE sid = $ID";
    //executing query
    if (mysql_query($query)) {
    print "<div style='background:#FFFFCC;border:dashed 1px #CCCCCC'>
    Record Updated successfully
    <a href='new_record.php'>Continue</a></div>";
    }else {
    error_Message(mysql_error()); //if error in query
    }
    }
    //error message
    function error_Message($error) {
    $msg = "<div style='background:#FFFFCC;border:dashed 1px #CCCCCC'>
    $error <a href='javascript:history.go(-1)'>Back</a></div>";
    die($msg);
    }

    //cleaning string
    function cleanString ($string) {
    $string = htmlspecialchars (trim ($string));
    if(!get_magic_quotes_gpc()) {
    $string = addslashes ($string);
    }
    return $string;
    }

    ?>

  10. #34
    moon_6432000's Avatar
    moon_6432000 is offline Senior Member+
    Last Online
    1st January 2024 @ 08:06 AM
    Join Date
    18 Jul 2008
    Location
    Kamra, Attock
    Age
    38
    Gender
    Male
    Posts
    530
    Threads
    13
    Credits
    129
    Thanked
    25

    Default

    app is ko khod chek karan
    man app k jawab k intezar karon ga.
    Shokriya.

  11. #35
    Join Date
    16 Aug 2009
    Age
    38
    Posts
    7
    Threads
    1
    Credits
    965
    Thanked
    0

    Default

    its good but hum ko mukamal project bana k dekhayien takay hum issee platform pe sab seekh jayein kaheen jana na paray

  12. #36
    bais is offline Senior Member
    Last Online
    31st July 2015 @ 02:07 PM
    Join Date
    23 Aug 2008
    Location
    Izlooo
    Gender
    Male
    Posts
    3,519
    Threads
    96
    Thanked
    263

    Default


    salmti ho aap per itnee achi sharing

Page 3 of 7 FirstFirst 123456 ... LastLast

Similar Threads

  1. PHP MySQL Class-3
    By shakeel in forum PHP MySQL
    Replies: 169
    Last Post: 9th September 2016, 10:10 AM
  2. PHP MySQL Class-7
    By shakeel in forum PHP MySQL
    Replies: 97
    Last Post: 18th August 2016, 01:02 PM
  3. PHP MySQL Class-12
    By shakeel in forum PHP MySQL
    Replies: 60
    Last Post: 10th August 2016, 11:48 AM
  4. PHP MySQL Class-18
    By shakeel in forum PHP MySQL
    Replies: 71
    Last Post: 9th April 2016, 04:07 PM
  5. MySql first class
    By aajizUsmani in forum Courses
    Replies: 4
    Last Post: 23rd March 2014, 02:13 PM

Bookmarks

Posting Permissions

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