Page 99 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 99

$remain = 6;
                                    $conn = mysql_connect("localhost","root","pi");
                                    mysql_query('SET NAMES utf8');
                                    if(!$conn) {
                                        echo  "Unable to connect to DB: " . mysql_error();
                                        exit;
                                    }
                                    if(!mysql_select_db("parkdata")){
                                        echo "Unnable to select mydbname: " . mysql_error();
                                        exit;
                                    }




                                    $sql = "SELECT *
                                        FROM town
                                        LIMIT 10";


                                    $result = mysql_query($sql);


                                    if(!$result) {
                                        echo "No rows found, nothing to print so am exiting";
                                        exit;
                                    }
                                    if(mysql_num_rows($result) == 0) {
                                        echo "No rows found, nothing to print so am exiting";
                                        exit;
                                    }



                                    echo "<table>";
                                    echo "<center>";
                                    echo "<tr
                                  span style='color: B0B0B0;
                                  text-shadow: none;
                                  font-size: 20px;
                                  line-height: 30px;
                                  font-weight: 700;
                                  font-family: Montserrat, sans-serif;
                                  background-color: rgba(0, 0, 0, 0);
                                  text-decoration: none;
                                  text-transform: uppercase;
                                  border-width: 0px;
                                  border-color: #000;
                                  border-style: none;'><td>ID</td><td>CAR LOCATION</td><td>TIME LOG</td></tr>";

                                    while($row = mysql_fetch_assoc($result)){



                                                         -  92  -
   94   95   96   97   98   99   100   101   102   103   104