انت تستخدم اخر اصدار شكرا لك

  • More
  • أخر التعليقات

    Example of using the connection file to get data from the Database


     

    <?php

        include 'conn.php';
            $conn = OpenCon();
            $sql = "SELECT id, name, age FROM table_name WHERE culumn_name=value";

            $result = $conn->query($sql);

            if ($result->num_rows > 0
            {
                // output data of each row
                while($row = $result->fetch_assoc()) 
                {
                    echo 
                     " ID: " . $row["id"].
                     " Culumn1: " . $row["culumn1"].
                     " Culumn2: " . $row["culumn2"]. 
                     "<br>";
                }
            } else {
                echo "0 results";
            }

        CloseCon($conn);

    ?>

    No comments :

    Post a Comment