• Save
Dynamic web 13
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,981
On Slideshare
1,493
From Embeds
488
Number of Embeds
4

Actions

Shares
Downloads
0
Comments
0
Likes
1

Embeds 488

http://usukhuu-dynamic-web.blogspot.com 447
http://it7001.blogspot.com 36
http://www.it7001.blogspot.com 4
http://www.usukhuu-dynamic-web.blogspot.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. MySQL server дээр ажиллах
    http://Usukhuu-dynamic-web.blogspot.com/
    Хичээлийн нэр:Динамик вэб програмчлал
    Хичээлийн төрөл:Лекц /№13/
    Багшийн нэр:Г.Өсөхжаргал
  • 2. http://Usukhuu-dynamic-web.blogspot.com/
    Өгөгдлийн сангаа сонгоод Export дар
  • 3. http://Usukhuu-dynamic-web.blogspot.com/
  • 4. http://Usukhuu-dynamic-web.blogspot.com/
    Sqlфайлын нэрийг өгнө
  • 5. Үүсгэсэн sqlфайлаа задлахдаа
    Sqlфайлаа нээгээд бүхлээр нь хуулаад MySQL -> SQL сонгоод тэндээ хуулж ажиллуулна. Ингэхдээ эхлээд өгөгдлийн сангийн нэртэй ижил өгөгдлийн санг үүсгэж өгөх хэрэгтэй.
    http://Usukhuu-dynamic-web.blogspot.com/
  • 6. http://Usukhuu-dynamic-web.blogspot.com/
  • 7. http://Usukhuu-dynamic-web.blogspot.com/
  • 8. http://Usukhuu-dynamic-web.blogspot.com/
  • 9. http://Usukhuu-dynamic-web.blogspot.com/
  • 10. http://Usukhuu-dynamic-web.blogspot.com/
  • 11. http://Usukhuu-dynamic-web.blogspot.com/
    Relation view дарахад дээрх хэсэг харагдана
  • 12. http://Usukhuu-dynamic-web.blogspot.com/
    Header.php
    <table width="800" height="603" border="1" align="center">
    <tr height="100" >
    <td height="103" colspan="3" background="uul.bmp“align="right" valign="top">
    <?phpecho "<table border=1>";
    $conn=mysql_connect("localhost","root","");
    mysql_query('set names utf8');
    mysql_select_db("test",$conn);
    $sql=mysql_query("Select * from new");
    while($row=mysql_fetch_array($sql))
    {echo "<tr><td>".$row['ID']."<td>".$row['lname']."<td>“.$row['fname'];
  • 13. http://Usukhuu-dynamic-web.blogspot.com/
    echo "</tr>";
    echo "<br>“;}
    mysql_close($conn);
    echo "</table>“; ?>
    </td>
    </tr>
    <tr height="450“><td width="400">
    <a href="index.php?send=medee">Мэдээ</a><br>
    <a href="index.php?send=zar">Зар</a><br>
    </td>
    <td width="200">
    Header.php
  • 14. Header.php
    <?php
    if (!empty($_GET)) {
    extract($_GET);
    if($send=="medee")
    include("../medeeform.php");
    else
    if($send=="zar")
    include("../medeevzeh.php");
    else
    include("big.php");}
    ?></td><td width="200">&nbsp;</td></tr>
    http://Usukhuu-dynamic-web.blogspot.com/
  • 15. http://Usukhuu-dynamic-web.blogspot.com/
    Footer.php
    <tr height="50">
    <td colspan="3" align="right">Copyright</td>
    </tr>
    </table>
    </body>
    </html>
  • 16. http://Usukhuu-dynamic-web.blogspot.com/
    Main.php
    <?php
    include ("header.php");
    include ("footer.php");
    ?>
  • 17. http://Usukhuu-dynamic-web.blogspot.com/
  • 18. Өгөгдлийн сангаас уншсан өгөгдлөө хүснэгтэнд харуулах
    <table border="1">
    <?php
    $conn=mysql_connect("localhost","root","");
    mysql_query('set names utf8');
    mysql_select_db("test",$conn);
    $sql=mysql_query("Select * from new");
    while($row=mysql_fetch_array($sql))
    {
    Echo"<tr><td>".$row['ID']."<td>".$row['lname']."<td>".$row['fname'];
    http://Usukhuu-dynamic-web.blogspot.com/
  • 19. Өгөгдлийн сангаас уншсан өгөгдлөө хүснэгтэнд харуулах
    echo "</tr>";
    echo "<br>";
    }
    mysql_close($conn);
    ?>
    </table>
    http://Usukhuu-dynamic-web.blogspot.com/
  • 20. Мэдээ оруулах форм үүсгэх medeeform.php
    <body>
    <form action="medeeoruulah.php" method="post" enctype="multipart/form-data">
    <table width="200" border="1">
    <tr>
    <td>Гарчиг: <input type="text" name="garchig"/></td>
    </tr>
    <tr>
    <td>Агуулга: <textareacols="50" rows="10" name="aguulga"> </textarea></td>
    </tr>
    http://Usukhuu-dynamic-web.blogspot.com/
  • 21. http://Usukhuu-dynamic-web.blogspot.com/
    <tr>
    <td>Дэлгэрэнгүй: <textareacols="50" rows="10" name="delgerengui"></textarea></td>
    </tr>
    <tr>
    <td>Зураг: <input type="file" name=“zurag" /> </td>
    </tr>
    </table>
    <input type="submit" name="submit" value=“нэмэх" />
    </form>
    </body>
    Мэдээ оруулах форм үүсгэх medeeform.php
  • 22. Мэдээ оруулах форм үүсгэх medeeoruulah.php
    <body>
    <?php
    if (($_FILES["zurag"]["type"] == "image/gif")
    || ($_FILES["zurag"]["type"] == "image/jpeg")
    || ($_FILES["zurag"]["type"] == "image/pjpeg")
    || ($_FILES["zurag"]["type"] == "image/bmp")){
    if ($_FILES["zurag"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["zurag"]["error"] . "<br />";
    }
    http://Usukhuu-dynamic-web.blogspot.com/
  • 23. Мэдээ оруулах форм үүсгэх medeeoruulah.php
    else
    { $zurag=$_FILES["zurag"]["name"];
    if (file_exists("upload/" . $_FILES["zurag"]["name"]))
    { echo $_FILES["zurag"]["name"] . " already exists. “; }
    else
    {
    move_uploaded_file($_FILES["zurag"]["tmp_name"],
    "upload/" . $_FILES["zurag"]["name"]);
    }
    }
    }
    http://Usukhuu-dynamic-web.blogspot.com/
  • 24. Мэдээ оруулах форм үүсгэх medeeoruulah.php
    else
    { echo "Invalid file“; }
    ?>
    <?php
    $conn = mysql_connect("localhost","root","");
    mysql_query("SET NAMES utf-8");
    if (!$conn) { die('Холбогдож чадсангүй: ' . mysql_error()); }
    mysql_select_db("usukhuu", $conn);
    http://Usukhuu-dynamic-web.blogspot.com/
  • 25. Мэдээ оруулах форм үүсгэх medeeoruulah.php
    $sql="INSERT INTO medee(Garchig, Towch, Delgerengvi, Zurag) VALUES ('$_POST[garchig]','$_POST[aguulga]','$_POST[delgerengui]','$zurag')";
    if (!mysql_query($sql,$conn)) {
    die('Error: ' . mysql_error());
    }
    echo "1 бичлэг нэмэгдлээ";
    mysql_close($conn);
    ?>
    </body>
    http://Usukhuu-dynamic-web.blogspot.com/
  • 26. Мэдээ оруулах форм үүсгэх medeevzeh.php
    <body>
    <?php
    $conn=mysql_connect("localhost","root","");
    mysql_select_db("usukhuu",$conn);
    $sql=mysql_query("Select * from medee");
    while($row=mysql_fetch_array($sql))
    {
    http://Usukhuu-dynamic-web.blogspot.com/
  • 27. Мэдээ оруулах форм үүсгэх medeevzeh.php
    echo $row['Medee_id']." ".$row['Garchig']." ".$row['Towch']." ".$row['Delgerengvi']." "."<img width=50 height=50 src='../upload/".$row['Zurag']."'>";
    echo "<br>";
    }
    mysql_close($conn);
    ?>
    </body>
    </html>
    http://Usukhuu-dynamic-web.blogspot.com/