Forum Sementara Putera.com

Bersama kita perkemaskan forum ini sementara forum asal dalam pemulihan.

Forum putera dah kembali. Masalah sudah berjaya diselesaikan. Sila lawati http://forum.putera.com/tanya


    Coding search php mysql

    Share

    Farlee
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 38
    Age : 33
    Location : Kuala Lumpur, Kuala Terengganu (Malaysia)
    Job/hobbies : Looking at Computer
    Registration date : 16/03/2009

    Re: Coding search php mysql

    Post by Farlee on Thu Mar 19, 2009 5:13 pm

    la... mana value kat tag <select><option></option></select> tu, syira? Erm 3 data tu dalam bentuk varchar ke?
    Kena cek dgn data dlm database, sama ke x dgn input yg kita nak.

    Kuzie
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 125
    Age : 32
    Location : eVeRyWhErE
    Registration date : 13/02/2009

    Re: Coding search php mysql

    Post by Kuzie on Thu Mar 19, 2009 5:23 pm

    syira86... Ni satu lagi soalan...
    3 data ni dalam database awak set macam ni ke?

    room varchar(30)
    date date
    time time

    ke semua set varchar..??kalau awak set semua varchar tu camne nak cari date dgn time die......??penin2...hehhehehe

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Thu Mar 19, 2009 5:38 pm

    a'ah..cz lect suh wat mcm 2...cz date,room n time sume dah ditetapkn..if sy gune format sql..so sy xdpt wat 9-11am la...kn format sql utk date 09:00:00..kn..so lect suh sy gune varchar....nk sy bg databse ker????...

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Thu Mar 19, 2009 5:41 pm

    Code:

    # phpMyAdmin MySQL-Dump
    # version 2.3.0-rc3
    # http://phpwizard.net/phpMyAdmin/
    # http://www.phpmyadmin.net/ (download page)
    #
    # Host: localhost
    # Generation Time: Mar 05, 2009 at 08:02 PM
    # Server version: 4.00.00
    # PHP Version: 4.2.2
    # Database : `seminar`
    # --------------------------------------------------------

    #
    # Table structure for table `student`
    #

    CREATE TABLE student (
      id int(100) NOT NULL default '0',
      code varchar(12) NOT NULL default '0',
      date varchar(10) NOT NULL default '0000-00-00',
      time varchar(6) default NULL,
      room varchar(6) NOT NULL default '0',
      title varchar(100) NOT NULL default '',
      name varchar(100) NOT NULL default '',
      PRIMARY KEY  (id)
    ) TYPE=MyISAM;

    #
    # Dumping data for table `student`
    #

    INSERT INTO student VALUES (41, 'Multimedia', '25/03/2009', '2-5.30', 'dkg4/3', 'Learn 3dMax', 'En.Daud');
    INSERT INTO student VALUES (40, 'Tid3023', '25/03/2009', '11-1.3', 'dkg4/3', 'Admin Database', 'Pn.Julaina Wahid');
    INSERT INTO student VALUES (39, 'Tid3033', '25/03/2009', '9-11am', 'dkg4/3', 'Pengenalan Sistem Maklumat', 'Cik.Hasliza');
    INSERT INTO student VALUES (38, 'network', '24/03/2009', '2-5.30', 'dkg4/2', 'Jobkey', 'En.yusof');
    INSERT INTO student VALUES (37, 'Agen Pintar', '23/03/2009', '11-1.3', 'dkg4/2', 'Develop using Jomlah', 'En.salleh');
    INSERT INTO student VALUES (36, 'Cisco', '24/03/2009', '9-11am', 'dkg4/2', 'Networking', 'En.Adi');
    INSERT INTO student VALUES (35, 'TIJ3042', '23/03/2009', '2-5.30', 'dkg4/1', 'Develop web using VB.net', 'Prof .Zahar');
    INSERT INTO student VALUES (34, 'TIJ3043', '23/03/2009', '11-1.3', 'dkg4/1', 'Learn easy ASP development', 'En.Azmin B.Seman');
    INSERT INTO student VALUES (33, 'TIJ3043', '23/03/2009', '9-11am', 'dkg4/1', 'Develop Web using Php', 'En.Baharudin');


    Kuzie
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 125
    Age : 32
    Location : eVeRyWhErE
    Registration date : 13/02/2009

    Re: Coding search php mysql

    Post by Kuzie on Thu Mar 19, 2009 5:43 pm

    # phpMyAdmin MySQL-Dump
    # version 2.3.0-rc3
    # http://phpwizard.net/phpMyAdmin/
    # http://www.phpmyadmin.net/ (download page)
    #
    # Host: localhost
    # Generation Time: Mar 05, 2009 at 08:02 PM
    # Server version: 4.00.00
    # PHP Version: 4.2.2
    # Database : `seminar`
    # --------------------------------------------------------

    #
    # Table structure for table `student`
    #

    CREATE TABLE student (
    id int(100) NOT NULL default '0',
    code varchar(12) NOT NULL default '0',
    date Date; <-- tukar
    time Time; <-- tukar
    room varchar(6) NOT NULL default '0',
    title varchar(100) NOT NULL default '',
    name varchar(100) NOT NULL default '',
    PRIMARY KEY (id)
    ) TYPE=MyISAM;

    #
    # Dumping data for table `student`
    #

    INSERT INTO student VALUES (41, 'Multimedia', '25/03/2009', '2-5.30', 'dkg4/3', 'Learn 3dMax', 'En.Daud');
    INSERT INTO student VALUES (40, 'Tid3023', '25/03/2009', '11-1.3', 'dkg4/3', 'Admin Database', 'Pn.Julaina Wahid');
    INSERT INTO student VALUES (39, 'Tid3033', '25/03/2009', '9-11am', 'dkg4/3', 'Pengenalan Sistem Maklumat', 'Cik.Hasliza');
    INSERT INTO student VALUES (38, 'network', '24/03/2009', '2-5.30', 'dkg4/2', 'Jobkey', 'En.yusof');
    INSERT INTO student VALUES (37, 'Agen Pintar', '23/03/2009', '11-1.3', 'dkg4/2', 'Develop using Jomlah', 'En.salleh');
    INSERT INTO student VALUES (36, 'Cisco', '24/03/2009', '9-11am', 'dkg4/2', 'Networking', 'En.Adi');
    INSERT INTO student VALUES (35, 'TIJ3042', '23/03/2009', '2-5.30', 'dkg4/1', 'Develop web using VB.net', 'Prof .Zahar');
    INSERT INTO student VALUES (34, 'TIJ3043', '23/03/2009', '11-1.3', 'dkg4/1', 'Learn easy ASP development', 'En.Azmin B.Seman');
    INSERT INTO student VALUES (33, 'TIJ3043', '23/03/2009', '9-11am', 'dkg4/1', 'Develop Web using Php', 'En.Baharudin');


    Last edited by Kuzie on Thu Mar 19, 2009 6:10 pm; edited 2 times in total

    Kuzie
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 125
    Age : 32
    Location : eVeRyWhErE
    Registration date : 13/02/2009

    Re: Coding search php mysql

    Post by Kuzie on Thu Mar 19, 2009 5:46 pm

    <?php
    echo"<form method='POST' action='conference_slot2.php'>";


    echo"<select name='date'>
    <option>23/03/2009</option>
    <option>24/03/2009</option>
    <option>25/03/2009</option>

    </select>


    <select name='time'>
    <option value="morning">9-11am</option><--- update value
    <option value="Afternoon">11-1.3</option><--- update value
    <option value="Evening">2-5.30</option><--- update value

    </select>

    <select name='room'>
    <option value"room1">dkg4/1</option><--- update value
    <option value"room2">dkg4/2</option><--- update value
    <option value"room3">dkg4/3</option><--- update value

    </select>





    <input type='submit' value='Search' name='B1'></form>";





    ?>

    Kuzie
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 125
    Age : 32
    Location : eVeRyWhErE
    Registration date : 13/02/2009

    Re: Coding search php mysql

    Post by Kuzie on Thu Mar 19, 2009 6:01 pm

    Code:

    <?php

    $room=$_POST[room];
    $date=$_POST[date];
    $time=$_POST[time];

    $db = mysql_connect("localhost","","");
    if (!$db)
      {
      die('Could not connect: ' . mysql_error());
      }


    //Convert Date "/" kepada "-"
    $format = '%Y-%m-%d';
    $date =strtotime($date);
    $date = strftime($format, $date );

    if ($Select1 =='Morning')
    {
    $Season1 = "09:00:00";
    $Season2= "11:00:00";
    }
    if ($Select1 =='Afternoon')
    {
    $Season1 = "11:00:01";
    $Season2 = "13:30:00";
    }
    if ($Select1 =='Evening')
    {
    $Season1 = "14:00:01";
    $Season2 = "17:30:00";
    }

    $maklumat = mysql_query("SELECT * FROM code,date,time,room,title,name from student student where room = '$room' and Date = '".$date."' and Time BETWEEN '".$Season1."' AND '".$Season2."' ");

    echo
          "<table class=mediumtxt width=771 align=center border=1>";
    echo "<tr><td><b>PaperCode</b></td><td><b>Date</b></td>
    <td ><b>Time</b></td>
    <td><b>Room</b></td>
    <td><b>Conference Title</b></td>
    <td><b>Presenter Name</b></td></tr>";
    while ($myrow = mysql_fetch_assoc($maklumat)) {

    echo "<tr><td>";
    echo $myrow["code"];
    echo "</td><td>";
    echo $myrow["date"];
    echo "</td><td>";
    echo $myrow["time"];
    echo "</td><td>";
    echo $myrow["room"];
    echo "</td><td>";
    echo $myrow["title"];
    echo "</td><td>";
    echo $myrow["name"];
    echo "</td></tr>";
    }
    echo "</table></div>
          </div>
          </div>
          </div>
          </div>
          </div>
          </div>
          </div>
          </div>
          ";
    mysql_close($con);
    ?>

    try copy paste code atas...

    Kuzie
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 125
    Age : 32
    Location : eVeRyWhErE
    Registration date : 13/02/2009

    Re: Coding search php mysql

    Post by Kuzie on Thu Mar 19, 2009 6:23 pm

    Ni cuma nak bagi pendapat la ye syira..Date tu sepatutnye xleh fix..kalau fix camne user nak masukkan date..kire sistem leh guna sekali jek...Satu lagi kalau tukar date tu kepada calendar kena tambah coding javascript plak...Tapi senang je cuma download dari tenet jek boleh dapat..cuma usaha sikit jek.....Kalau nak pun saya boleh bagi...

    So kalau dalam database tu tukar date dgn time bermakna form2 lain pun kena tukar function die...Time tu mungkin xde masalah sbb boleh edit je dari database..Tapi bab date tu macam susah sikit sbb user yg key in..kalau form lain ada kena mengena dgn database student just convert jek macam contoh kat bawah ni....

    contoh convert tarikh dari 28/2/1984 kepada 28-2-1984:

    $date=$_POST[date]; <--- data yg di post

    $format = '%Y-%m-%d';
    $date =strtotime($date);
    $date = strftime($format, $date );

    echo $date; <--- tengok out put...

    Farlee
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 38
    Age : 33
    Location : Kuala Lumpur, Kuala Terengganu (Malaysia)
    Job/hobbies : Looking at Computer
    Registration date : 16/03/2009

    Re: Coding search php mysql

    Post by Farlee on Fri Mar 20, 2009 11:05 am

    Pasal key-in date & time ke dalam database tu bukan masalah, tapi cammana nak display time drpd database mengikut kehendak user, itu mmg mencabar sket. sebab format tarikh dalam database jika mengikut sistem timestamp adalah; Y-M-D : HHMM (kesemua data adalah nombor dan ada limitation; 24-hour format).

    Tapi kenapa saya suka format date n time mengikut database berbanding dengan PHP? sbb setting dabase mengikut mesin PC, manakala PHP setting mengikut PHP.ini (ini kena ubah utk papar masa dan tarikh yg tepat). Jadi tugas PHP ialah hanya mengubah format asal database dan papar tarikh dan masa yg bersesuaian dengan bacaan user.

    Code:
    <?php
    date(<format date yg dikehendaki>, strtotime($date));
    /*$date boleh diumpuk drpd $_POST/$_GET atau drpd baris database seperti: $row[date];*/
    ?>

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Fri Mar 20, 2009 4:54 pm

    salm..stm nie user xkey in ape2 pn..juz admin jer akn key in data tntg conference...user juz view slot seminar jer..sbnarnye sytm nie simple jer....mcm kite g seminar...dorg akn bg time table seminar dlm bntuk kertas...so bile ade perubahan mase, room @penceramah 2 xdpt hadir..kte kne update kn..if mkn sytm manual..cm myusahkn user cz xdpt info ape perubahn..cz sy kuar dng idea mcm nie...user xperlu login @dftar..juz wat searching utk room.date n time....die akn dpt info tnte seminar.....awk punye coding terlalu expert la...sy btl2 hargai jasa awk.....mslhnye stsym nie wat bnda simple jer....wat 3 carian ....

    Kuzie
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 125
    Age : 32
    Location : eVeRyWhErE
    Registration date : 13/02/2009

    Re: Coding search php mysql

    Post by Kuzie on Fri Mar 20, 2009 4:59 pm

    Ermm..kalau admin key in data date tu die key in macam mana???xexpert mana pun calendar ni...senang jek...

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Fri Mar 20, 2009 5:03 pm

    sy akn gune coding awk...tgok jdi ke x....nti sy bgtau if dah berjaya,....tima kasih ye awk kuzie n farlee

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Fri Mar 20, 2009 5:09 pm

    Code:

    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Insert Data Into mySQL Database</title>
    </head>

    <body bgcolor="#FFFFFF">

    <div align="center">
       <table border="0" cellpadding="0" cellspacing="0" width="839" height="1056">
          <!-- MSTableType="layout" -->
          <tr>
          a   <td valign="top" height="213">
             <!-- MSCellType="ContentHead" -->
             <div style="position: absolute; width: 356px; height: 100px; z-index: 1; left: 567px; top: 103px" id="layer1">
       <font size="7">Adminstration</font></div>
             <img border="0" src="tie_logo.gif" width="839" height="213"></td>
          </tr>
          <tr>
             <td valign="top" msopnltype="NavBody" align="center" height="843" width="839">
             <!-- MSCellType="ContentBody" -->
             <table cellpadding="0" cellspacing="0" width="839" height="843">
       <!-- MSCellFormattingTableID="3" -->
       <tr>
          <td colspan="2" height="10">
          <img alt="" width="839" height="10" src="MsoPnl_sh_l_3AD.jpg"></td>
       </tr>
       <tr>
          <td width="10">
          <img alt="" width="10" height="833" src="MsoPnl_sh_t_3AE.jpg"></td>
          <td height="833" width="829">
             <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
                <tr>
                   <td bgcolor="#E60000" nowrap colspan="3" height="26">
                   <!-- MSCellFormattingType="header" -->
                   <p align="center"><b><font size="5"><a href="update.php">
                   <span style="text-decoration: none"><font color="#000000">UPDATE&nbsp;&nbsp;&nbsp;
                   </font></span></a><a href="view1.php">
                   <span style="text-decoration: none"><font color="#000000">VIEW</font></span></a></font></b></p>
                   </td>
                </tr>
                <tr>
                   <td valign="top" bgcolor="#FFFFFF" msopnltype="NavBody" align="center" colspan="3" height="100%">
                   <!-- MSCellFormattingType="content" -->
                   <p align="center">&nbsp;</p>
                   <p>&nbsp;</p>
                   <p>&nbsp;</p>
                   <p>&nbsp;</p>
                   <table width="496" border="0" align="center" cellpadding="0" cellspacing="1">
                      <tr>
                         <td>
                         <form name="form1" method="post" action="insert.php">
                            <div align="center">
                               <table width="493" border="0" cellspacing="1" cellpadding="3" bgcolor="#E60000">
                                  <tr>
                                     <td colspan="3" bgcolor="#FFFFFF">
                                     <p align="center"><b><font size="5">ADD CONFERENCE</font></b><p align="center">&nbsp;</td>
                                  </tr>
                                  <tr>
                                     <td width="145" align="center">
                                     <p align="justify" style="line-height: 150%">
                                     <b>Paper Code</b></td>
                                     <td width="3" align="center">
                                     <p align="justify" style="line-height: 150%">:</td>
                                     <td width="323" align="center">
                                     <p align="justify" style="line-height: 150%">
                                     <input name="code" type="text" id="code"></td>
                                  </tr>
                                  <tr>
                                     <td width="145" align="center">
                                     <p align="justify" style="line-height: 150%">
                                     <b>Date</b></td>
                                     <td width="3" align="center">
                                     <p align="justify" style="line-height: 150%">:</td>
                                     <td width="323" align="center">
                                     <p align="justify" style="line-height: 150%">
                                     <select size="1" name="date">
                                     <option>23/03/2009</option>
                                     <option>24/03/2009</option>
                                     <option>25/03/2009</option>
                                     </select></td>
                                  </tr>
                                  <tr>
                                     <td width="145" align="center">
                                     <p align="justify" style="line-height: 150%">
                                     <b>Time</b></td>
                                     <td width="3" align="center">
                                     <p align="justify" style="line-height: 150%">:</td>
                                     <td width="323" align="center">
                                     <p align="justify" style="line-height: 150%">
                                     <select size="1" name="time">
                                     <option>9-11am</option>
                                     <option>11-1.30pm</option>
                                     <option>2-5.30pm</option>
                                     </select></td>
                                  </tr>
                                  <tr>
                                     <td align="center">
                                     <p align="justify" style="line-height: 150%">
                                     <b>Room</b></td>
                                     <td align="center">
                                     <p align="justify" style="line-height: 150%">:</td>
                                     <td align="center">
                                     <p align="justify" style="line-height: 150%">
                                     <select size="1" name="room">
                                     <option>dkg4/1</option>
                                     <option>dkg4/2</option>
                                     <option>dkg4/3</option></select></td>
                                  </tr>
                                  <tr>
                                     <td align="center">
                                     <p align="justify" style="line-height: 150%">
                                     <b>Conference Title</b></td>
                                     <td align="center">
                                     <p align="justify" style="line-height: 150%">:</td>
                                     <td align="center">
                                     <p align="justify" style="line-height: 150%">
                                     <input name="title" type="text" id="title"></td>
                                  </tr>
                                  <tr>
                                     <td align="center" height="29">
                                     <p align="justify" style="line-height: 150%">
                                     <b>Presenter Name</b></td>
                                     <td align="center" height="29">
                                     <p align="justify" style="line-height: 150%">:</td>
                                     <td align="center" height="29">
                                     <p align="justify" style="line-height: 150%">
                                     <input name="name" type="text" id="name"></td>
                                  </tr>
                                  <tr>
                                     <td colspan="3" align="center" height="81">
                                     <input type="submit"    name "submit " onclick = "alert ('You have successfull added conference!!!')" value="submit" name="submit">&nbsp;</td>
                                  </tr>
                               </table></div>
                         </form></td>
                      </tr>
                   </table>&nbsp;</td>
                </tr>
                <tr>
                   <td width="20">
                   <img alt="" src="MsoPnl_Cnr_bl_3AF.gif" width="20" height="19"></td>
                   <td nowrap bgcolor="#E60000" width="100%">
                   <!-- MSCellFormattingType="footer" -->
                   &nbsp;</td>
                   <td height="19" width="20">
                   <img alt="" src="MsoPnl_Cnr_br_3B1.gif" width="20" height="19"></td>
                </tr>
             </table>
             </td>
       </tr>
             </table>
             </td>
          </tr>
       </table>
    </div>
    </body>

    </html>

    mcm nie sy wat...

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Fri Mar 20, 2009 5:11 pm

    Code:

    <?php



    // Connect to server and select database.
    mysql_connect("localhost", "", "")or die("cannot connect");
    mysql_select_db("seminar")or die("cannot select DB");

    // Get values from

    $code=$_POST['code'];
    $date=$_POST['date'];
    $time=$_POST['time'];
    $room=$_POST['room'];
    $title=$_POST['title'];
    $name=$_POST['name'];




    // Insert data into mysql
    $sql="INSERT INTO student(code,date,time,room,title,name)VALUES('$code','$date','$time','$room','$title','$name')";
    $result=mysql_query($sql);

    // if successfully insert data into database, displays message "Successful".
    if($result){
    echo "Successful";
    echo "<BR>";
    echo "<a href='proses.php'>Back to main page</a>";
    }


    else {
    echo "ERROR";
    }

    // close connection
    mysql_close();
    ?>
    <body bgcolor="#FF0000">
    <p>&nbsp;</p>

    cmne nk wat xbg data yg sama xle ade dlm datbase...mcm kuar error msg la...nie pn xtau wat la....

    Kuzie
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 125
    Age : 32
    Location : eVeRyWhErE
    Registration date : 13/02/2009

    Re: Coding search php mysql

    Post by Kuzie on Fri Mar 20, 2009 5:35 pm

    dalam database kena ada unix ID..baru data tu xsama...PRIMARY KEY..

    Error ape?

    Kuzie
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 125
    Age : 32
    Location : eVeRyWhErE
    Registration date : 13/02/2009

    Re: Coding search php mysql

    Post by Kuzie on Fri Mar 20, 2009 5:36 pm

    Code:
    /* PopUp Calendar v2.1
    © PCI, Inc.,2000 • Freeware
    webmaster@personal-connections.com
    +1 (925) 955 1624
    Permission granted  for unlimited use so far
    as the copyright notice above remains intact. */

    /* Settings. Please read readme.html file for instructions*/
    var ppcDF = "m/d/Y";
    var ppcMN = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
    var ppcWN = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    var ppcER = new Array(4);
    ppcER[0] = "Required DHTML functions are not supported in this browser.";
    ppcER[1] = "Target form field is not assigned or not accessible.";
    ppcER[2] = "Sorry, the chosen date is not acceptable. Please read instructions on the page.";
    ppcER[3] = "Unknown error occured while executing this script.";
    var ppcUC = false;
     var ppcUX = 4;
     var ppcUY = 4;

    /* Do not edit below this line unless you are sure what are you doing! */

    var ppcIE=(navigator.appName == "Microsoft Internet Explorer");
    var ppcNN=((navigator.appName == "Netscape")&&(document.layers));
    var ppcTT="<table width=\"200\" cellspacing=\"1\" cellpadding=\"2\" border=\"1\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\">\n";
    var ppcCD=ppcTT;var ppcFT="<font face=\"MS Sans Serif, sans-serif\" size=\"1\" color=\"#000000\">";var ppcFC=true;
    var ppcTI=false;var ppcSV=null;var ppcRL=null;var ppcXC=null;var ppcYC=null;
    var ppcML=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
    var ppcWE=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    var ppcNow=new Date();var ppcPtr=new Date();
    if (ppcNN) {
     window.captureEvents(Event.RESIZE);
     window.onresize = restoreLayers;
     document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
     document.onmousedown = recordXY;
     document.onmouseup = confirmXY;}
    function restoreLayers(e) {
     if (ppcNN) {
      with (window.document) {
      open("text/html");
      write("<html><head><title>Restoring the layer structure...</title></head>");
      write("<body bgcolor=\"#FFFFFF\" onLoad=\"history.go(-1)\">");
      write("</body></html>");
      close();}}}
    function recordXY(e) {
     if (ppcNN) {
      ppcXC = e.x;
      ppcYC = e.y;
      document.routeEvent(e);}}
    function confirmXY(e) {
     if (ppcNN) {
      ppcXC = (ppcXC == e.x) ? e.x : null;
      ppcYC = (ppcYC == e.y) ? e.y : null;
      document.routeEvent(e);}}
    function getCalendarFor(target,rules) {
     ppcSV = target;
     ppcRL = rules;
     if (ppcFC) {setCalendar();ppcFC = false;}
     if ((ppcSV != null)&&(ppcSV)) {
      if (ppcIE) {
      var obj = document.all['PopUpCalendar'];
      obj.style.left = document.body.scrollLeft+event.clientX;
      obj.style.top  = document.body.scrollTop+event.clientY;
      obj.style.visibility = "visible";}
      else if (ppcNN) {
      var obj = document.layers['PopUpCalendar'];
      obj.left = ppcXC
      obj.top  = ppcYC
      obj.visibility = "show";}
      else {showError(ppcER[0]);}}
     else {showError(ppcER[1]);}}
    function switchMonth(param) {
     var tmp = param.split("|");
     setCalendar(tmp[0],tmp[1]);}
    function moveMonth(dir) {
     var obj = null;
     var limit = false;
     var tmp,dptrYear,dptrMonth;
     if (ppcIE) {obj = document.ppcMonthList.sItem;}
     else if (ppcNN) {obj = document.layers['PopUpCalendar'].document.layers['monthSelector'].document.ppcMonthList.sItem;}
     else {showError(ppcER[0]);}
     if (obj != null) {
      if ((dir.toLowerCase() == "back")&&(obj.selectedIndex > 0)) {obj.selectedIndex--;}
      else if ((dir.toLowerCase() == "forward")&&(obj.selectedIndex < 12)) {obj.selectedIndex++;}
      else {limit = true;}}
     if (!limit) {
      tmp = obj.options[obj.selectedIndex].value.split("|");
      dptrYear  = tmp[0];
      dptrMonth = tmp[1];
      setCalendar(dptrYear,dptrMonth);}
     else {
      if (ppcIE) {
      obj.style.backgroundColor = "#FF0000";
      window.setTimeout("document.ppcMonthList.sItem.style.backgroundColor = '#FFFFFF'",50);}}}
    function selectDate(param) {
     var arr  = param.split("|");
     var year  = arr[0];
     var month = arr[1];
     var date  = arr[2];
     var ptr = parseInt(date);
     ppcPtr.setDate(ptr);
     if ((ppcSV != null)&&(ppcSV)) {
      if (validDate(date)) {ppcSV.value = dateFormat(year,month,date);hideCalendar();}
      else {showError(ppcER[2]);if (ppcTI) {clearTimeout(ppcTI);ppcTI = false;}}}
     else {
      showError(ppcER[1]);
      hideCalendar();}}
    function setCalendar(year,month) {
     if (year  == null) {year = getFullYear(ppcNow);}
     if (month == null) {month = ppcNow.getMonth();setSelectList(year,month);}
     if (month == 1) {ppcML[1]  = (isLeap(year)) ? 29 : 28;}
     ppcPtr.setYear(year);
     ppcPtr.setMonth(month);
     ppcPtr.setDate(1);
     updateContent();}
    function updateContent() {
     generateContent();
     if (ppcIE) {document.all['monthDays'].innerHTML = ppcCD;}
     else if (ppcNN) {
      with (document.layers['PopUpCalendar'].document.layers['monthDays'].document) {
      open("text/html");
      write("<html>\n<head>\n<title>DynDoc</title>\n</head>\n<body bgcolor=\"#FFFFFF\">\n");
      write(ppcCD);
      write("</body>\n</html>");
      close();}}
     else {showError(ppcER[0]);}
     ppcCD = ppcTT;}
    function generateContent() {
     var year  = getFullYear(ppcPtr);
     var month = ppcPtr.getMonth();
     var date  = 1;
     var day  = ppcPtr.getDay();
     var len  = ppcML[month];
     var bgr,cnt,tmp = "";
     var j,i = 0;
     for (j = 0; j < 7; ++j) {
      if (date > len) {break;}
      for (i = 0; i < 7; ++i) {
      bgr = ((i == 0)||(i == 6)) ? "#FFFFCC" : "#FFFFFF";
      if (((j == 0)&&(i < day))||(date > len)) {tmp  += makeCell(bgr,year,month,0);}
      else {tmp  += makeCell(bgr,year,month,date);++date;}}
      ppcCD += "<tr align=\"center\">\n" + tmp + "</tr>\n";tmp = "";}
     ppcCD += "</table>\n";}
    function makeCell(bgr,year,month,date) {
     var param = "\'"+year+"|"+month+"|"+date+"\'";
     var td1 = "<td width=\"20\" bgcolor=\""+bgr+"\" ";
     var td2 = (ppcIE) ? "</font></span></td>\n" : "</font></a></td>\n";
     var evt = "onMouseOver=\"this.style.backgroundColor=\'#FF0000\'\" onMouseOut=\"this.style.backgroundColor=\'"+bgr+"\'\" onMouseUp=\"selectDate("+param+")\" ";
     var ext = "<span Style=\"cursor: hand\">";
     var lck = "<span Style=\"cursor: default\">";
     var lnk = "<a href=\"javascript:selectDate("+param+")\" onMouseOver=\"window.status=\' \';return true;\">";
     var cellValue = (date != 0) ? date+"" : "&nbsp;";
     if ((ppcNow.getDate() == date)&&(ppcNow.getMonth() == month)&&(getFullYear(ppcNow) == year)) {
      cellValue = "<b>"+cellValue+"</b>";}
     var cellCode = "";
     if (date == 0) {
      if (ppcIE) {cellCode = td1+"Style=\"cursor: default\">"+lck+ppcFT+cellValue+td2;}
      else {cellCode = td1+">"+ppcFT+cellValue+td2;}}
     else {
      if (ppcIE) {cellCode = td1+evt+"Style=\"cursor: hand\">"+ext+ppcFT+cellValue+td2;}
      else {
      if (date < 10) {cellValue = "&nbsp;" + cellValue + "&nbsp;";}
      cellCode = td1+">"+lnk+ppcFT+cellValue+td2;}}
     return cellCode;}
    function setSelectList(year,month) {
     var i = 0;
     var obj = null;
     if (ppcIE) {obj = document.ppcMonthList.sItem;}
     else if (ppcNN) {obj = document.layers['PopUpCalendar'].document.layers['monthSelector'].document.ppcMonthList.sItem;}
     else {/* NOP */}
     while (i < 13) {
      obj.options[i].value = year + "|" + month;
      obj.options[i].text  = year + " • " + ppcMN[month];
      i++;
      month++;
      if (month == 12) {year++;month = 0;}}}
    function hideCalendar() {
     if (ppcIE) {document.all['PopUpCalendar'].style.visibility = "hidden";}
     else if (ppcNN) {document.layers['PopUpCalendar'].visibility = "hide";window.status = " ";}
     else {/* NOP */}
     ppcTI = false;
     setCalendar();
     ppcSV = null;
     if (ppcIE) {var obj = document.ppcMonthList.sItem;}
     else if (ppcNN) {var obj = document.layers['PopUpCalendar'].document.layers['monthSelector'].document.ppcMonthList.sItem;}
     else {/* NOP */}
     obj.selectedIndex = 0;}
    function showError(message) {
     window.alert("[ PopUp Calendar ]\n\n" + message);}
    function isLeap(year) {
     if ((year%400==0)||((year%4==0)&&(year%100!=0))) {return true;}
     else {return false;}}
    function getFullYear(obj) {
     if (ppcNN) {return obj.getYear() + 1900;}
     else {return obj.getYear();}}
    function validDate(date) {
     var reply = true;
     if (ppcRL == null) {/* NOP */}
     else {
      var arr = ppcRL.split(":");
      var mode = arr[0];
      var arg  = arr[1];
      var key  = arr[2].charAt(0).toLowerCase();
      if (key != "d") {
      var day = ppcPtr.getDay();
      var orn = isEvenOrOdd(date);
      reply = (mode == "[^]") ? !((day == arg)&&((orn == key)||(key == "a"))) : ((day == arg)&&((orn == key)||(key == "a")));}
      else {reply = (mode == "[^]") ? (date != arg) : (date == arg);}}
     return reply;}
    function isEvenOrOdd(date) {
     if (date - 21 > 0) {return "e";}
     else if (date - 14 > 0) {return "o";}
     else if (date - 7 > 0) {return "e";}
     else {return "o";}}
    function dateFormat(year,month,date) {
     if (ppcDF == null) {ppcDF = "m/d/Y";}
     var day = ppcPtr.getDay();
     var crt = "";
     var str = "";
     var chars = ppcDF.length;
     for (var i = 0; i < chars; ++i) {
      crt = ppcDF.charAt(i);
      switch (crt) {
      case "M": str += ppcMN[month]; break;
      case "m": str += (month<9) ? ("0"+(++month)) : ++month; break;
      case "Y": str += year; break;
      case "y": str += year.substring(2); break;
      case "d": str += ((ppcDF.indexOf("m")!=-1)&&(date<10)) ? ("0"+date) : date; break;
      case "W": str += ppcWN[day]; break;
        default: str += crt;}}
     return unescape(str);}


    Copy Paste code kat atas tu dalam notepad. Save as pupdate.js

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Fri Mar 20, 2009 5:39 pm

    nie kne wat databse gak ker.....sy xbrape fhm dng coding nie

    Kuzie
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 125
    Age : 32
    Location : eVeRyWhErE
    Registration date : 13/02/2009

    Re: Coding search php mysql

    Post by Kuzie on Fri Mar 20, 2009 5:46 pm

    xpayah wat database...amik copy paste jek coding tu pastu paste dalam note pad..save as pupdate.js dalam folder sama yg awak wat coding tu....

    Code:

    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Insert Data Into mySQL Database</title>
    <script language="JavaScript" src="pupdate.js"></script>
    <style type="text/css">
    .style1 {
       text-align: left;
    }
    </style>
    </head>

    <body bgcolor="#FFFFFF">

    <div align="center">
      <table border="0" cellpadding="0" cellspacing="0" width="839" height="1056">
          <!-- MSTablea  <td valign="top" height="213">
            <!-- MSCellType="ContentHead" -->
            <div style="position: absolute; width: 356px; height: 100px; z-index: 1; left: 567px; top: 103px" id="layer1">
      <font size="7">Adminstration</font></div>
            <img border="0" src="tie_logo.gif" width="839" height="213">

          <tr>
            <td valign="top" msopnltype="NavBody" align="center" height="843" width="839">
            <!-- MSCellType="ContentBody" -->
            <table cellpadding="0" cellspacing="0" width="839" height="843">
      <!-- MSCellFormattingTableID="3" -->
      <tr>
          <td colspan="2" height="10">
          <img alt="" width="839" height="10" src="MsoPnl_sh_l_3AD.jpg"></td>
      </tr>
      <tr>
          <td width="10">
          <img alt="" width="10" height="833" src="MsoPnl_sh_t_3AE.jpg"></td>
          <td height="833" width="829">
            <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
                <tr>
                  <td bgcolor="#E60000" nowrap colspan="3" height="26">
                  <!-- MSCellFormattingType="header" -->
                  <p align="center"><b><font size="5"><a href="update.php">
                  <span style="text-decoration: none"><font color="#000000">UPDATE</font></span>
                  <span style="text-decoration: none"><font color="#000000"><a href="view1.php">
                VIEW</a></font></span></font>
                  </td>
                </tr>
                <tr>
                  <td valign="top" bgcolor="#FFFFFF" msopnltype="NavBody" align="center" colspan="3" height="100%">
                  <!-- MSCellFormattingType="content" -->
                  <p align="center">&nbsp;</p>
                  <p>&nbsp;</p>
                  <p>&nbsp;</p>
                  <p>&nbsp;</p>
                  <table width="496" border="0" align="center" cellpadding="0" cellspacing="1">
                      <tr>
                        <td>
                        <form name="form1" method="post" action="insert.php">
                            <div align="center">
                              <table width="493" border="0" cellspacing="1" cellpadding="3" bgcolor="#E60000">
                                  <tr>
                                    <td colspan="3" bgcolor="#FFFFFF">
                                    <p align="center"><b><font size="5">ADD
                               CONFERENCE</font></b><p align="center">&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td width="145" align="center">
                                    <p align="justify" style="line-height: 150%">
                                    <b>Paper Code</b></td>
                                    <td width="3" align="center">
                                    <p align="justify" style="line-height: 150%">:</td>
                                    <td width="323" align="center">
                                    <p align="justify" style="line-height: 150%">
                                    <input name="code" type="text" id="code"></td>
                                  </tr>
                                  <tr>
                                    <td width="145" align="center">
                                    <p align="justify" style="line-height: 150%">
                                    <b>Date</b></td>
                                    <td width="3" align="center">
                                    <p align="justify" style="line-height: 150%">:</td>
                                    <td width="323" class="style1">
                                    <input type="text" name="date" size="16" maxlength="32" onFocus="document.form1.button2.focus()" class="textfield" readonly >
                            <a href="javascript://" onClick="getCalendarFor(document.form1.date)"><span class="bodytext">Sila Pilih Tarikh</span></a>
                         </td>
                                  </tr>
                                  <tr>
                                    <td width="145" align="center">
                                    <p align="justify" style="line-height: 150%">
                                    <b>Time</b></td>
                                    <td width="3" align="center">
                                    <p align="justify" style="line-height: 150%">:</td>
                                    <td width="323" align="center">
                                    <p align="justify" style="line-height: 150%">
                                    <select size="1" name="time">
                                    <option>9-11am</option>
                                    <option>11-1.30pm</option>
                                    <option>2-5.30pm</option>
                                    </select></td>
                                  </tr>
                                  <tr>
                                    <td align="center">
                                    <p align="justify" style="line-height: 150%">
                                    <b>Room</b></td>
                                    <td align="center">
                                    <p align="justify" style="line-height: 150%">:</td>
                                    <td align="center">
                                    <p align="justify" style="line-height: 150%">
                                    <select size="1" name="room">
                                    <option>dkg4/1</option>
                                    <option>dkg4/2</option>
                                    <option>dkg4/3</option></select></td>
                                  </tr>
                                  <tr>
                                    <td align="center">
                                    <p align="justify" style="line-height: 150%">
                                    <b>Conference Title</b></td>
                                    <td align="center">
                                    <p align="justify" style="line-height: 150%">:</td>
                                    <td align="center">
                                    <p align="justify" style="line-height: 150%">
                                    <input name="title" type="text" id="title"></td>
                                  </tr>
                                  <tr>
                                    <td align="center" height="29">
                                    <p align="justify" style="line-height: 150%">
                                    <b>Presenter Name</b></td>
                                    <td align="center" height="29">
                                    <p align="justify" style="line-height: 150%">:</td>
                                    <td align="center" height="29">
                                    <p align="justify" style="line-height: 150%">
                                    <input name="name" type="text" id="name"></td>
                                  </tr>
                                  <tr>
                                    <td colspan="3" align="center" height="81">
                                    <input type="submit"    name "submit " onclick = "alert ('You have successfull added conference!!!')" value="submit" name="submit">&nbsp;</td>
                                  </tr>
                              </table></div>
                        </form></td>
                      </tr>
                  </table>&nbsp;</td>
                </tr>
                <tr>
                  <td width="20">
                  <img alt="" src="MsoPnl_Cnr_bl_3AF.gif" width="20" height="19"></td>
                  <td nowrap bgcolor="#E60000" width="100%">
                  <!-- MSCellFormattingType="footer" -->
                  &nbsp;</td>
                  <td height="19" width="20">
                  <img alt="" src="MsoPnl_Cnr_br_3B1.gif" width="20" height="19"></td>
                </tr>
            </table>
            </td>
      </tr>
            </table>
            </td>
          </tr>
      </table>
    </div>
    </body>
    <script language="JavaScript">
    if (document.all) {
     document.writeln("<div id=\"PopUpCalendar\" style=\"position:absolute; left:0px; top:0px; z-index:7; width:200px; height:77px; overflow: visible; visibility: hidden; background-color: #FFFFFF; border: 1px none #000000\" onMouseOver=\"if(ppcTI){clearTimeout(ppcTI);ppcTI=false;}\" onMouseOut=\"ppcTI=setTimeout(\'hideCalendar()\',500)\">");
     document.writeln("<div id=\"monthSelector\" style=\"position:absolute; left:0px; top:0px; z-index:9; width:181px; height:27px; overflow: visible; visibility:inherit\">");}
    else if (document.layers) {
     document.writeln("<layer id=\"PopUpCalendar\" pagex=\"0\" pagey=\"0\" width=\"200\" height=\"200\" z-index=\"100\" visibility=\"hide\" bgcolor=\"#FFFFFF\" onMouseOver=\"if(ppcTI){clearTimeout(ppcTI);ppcTI=false;}\" onMouseOut=\"ppcTI=setTimeout('hideCalendar()',500)\">");
     document.writeln("<layer id=\"monthSelector\" left=\"0\" top=\"0\" width=\"181\" height=\"27\" z-index=\"9\" visibility=\"inherit\">");}
    else {
     document.writeln("<p><font color=\"#FF0000\"><b>Error ! The current browser is either too old or too modern (usind DOM document structure).</b></font></p>");}
    </script>
    <noscript><p><font color="#FF0000"><b>JavaScript is not activated !</b></font></p></noscript>
    <table border="1" cellspacing="1" cellpadding="2" width="200" bordercolorlight="#000000" bordercolordark="#000000" vspace="0" hspace="0"><form name="ppcMonthList"><tr><td align="center" bgcolor="#CCCCCC"><a href="javascript:moveMonth('Back')" onMouseOver="window.status=' ';return true;"><font face="Arial, Helvetica, sans-serif" size="2" color="#000000"><b>
       &lt; </b></font></a><font face="MS Sans Serif, sans-serif" size="1">
    <select name="sItem" onMouseOut="if(ppcIE){window.event.cancelBubble = true;}" onChange="switchMonth(this.options[this.selectedIndex].value)" style="font-family: 'MS Sans Serif', sans-serif; font-size: 9pt"><option value="0" selected>
    2000 • January</option><option value="1">2000 • February</option><option value="2">
    2000 • March</option><option value="3">2000 • April</option><option value="4">
    2000 • May</option><option value="5">2000 • June</option><option value="6">2000
    • July</option><option value="7">2000 • August</option><option value="8">2000 •
    September</option><option value="9">2000 • October</option><option value="10">
    2000 • November</option><option value="11">2000 • December</option><option value="0">
    2001 • January</option></select></font><a href="javascript:moveMonth('Forward')" onMouseOver="window.status=' ';return true;"><font face="Arial, Helvetica, sans-serif" size="2" color="#000000"><b>
       &gt;</b></font></a></td></tr></form></table>
    <table border="1" cellspacing="1" cellpadding="2" bordercolorlight="#000000" bordercolordark="#000000" width="200" vspace="0" hspace="0"><tr align="center" bgcolor="#CCCCCC"><td width="20" bgcolor="#FFFFCC"><b><font face="MS Sans Serif, sans-serif" size="1">
       Su</font></b></td><td width="20"><b><font face="MS Sans Serif, sans-serif" size="1">
       Mo</font></b></td><td width="20"><b><font face="MS Sans Serif, sans-serif" size="1">
       Tu</font></b></td><td width="20"><b><font face="MS Sans Serif, sans-serif" size="1">
       We</font></b></td><td width="20"><b><font face="MS Sans Serif, sans-serif" size="1">
       Th</font></b></td><td width="20"><b><font face="MS Sans Serif, sans-serif" size="1">
       Fr</font></b></td><td width="20" bgcolor="#FFFFCC"><b><font face="MS Sans Serif, sans-serif" size="1">
       Sa</font></b></td></tr></table>
    <script language="JavaScript">
    if (document.all) {
     document.writeln("</div>");
     document.writeln("<div id=\"monthDays\" style=\"position:absolute; left:0px; top:52px; z-index:8; width:200px; height:17px; overflow: visible; visibility:inherit; background-color: #FFFFFF; border: 1px none #000000\"> </div></div>");}
    else if (document.layers) {
     document.writeln("</layer>");
     document.writeln("<layer id=\"monthDays\" left=\"0\" top=\"52\" width=\"200\" height=\"17\" z-index=\"8\" bgcolor=\"#FFFFFF\" visibility=\"inherit\"> </layer></layer>");}
    else {/*NOP*/}
    </script>

    </html>

    Copy paste coding ni plak dalam form update awak tu...Cuba run tengok camne....

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Sat Mar 21, 2009 11:45 am

    salam..ade error la yg kuzie bg 2
    Code:


    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in c:\phpdev5\www\seminarbaru\slot2.php on line 37

    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in c:\phpdev5\www\seminarbaru\slot2.php on line 46

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Sat Mar 21, 2009 11:52 am

    kuar error nie dlm coding awk bg 2(form update)


    Code:
    Error ! The current browser is either too old or too modern (usind DOM document structure).

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Sat Mar 21, 2009 11:59 am

    salam..ade error la yg kuzie bg 2
    Code:


    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in c:phpdev5wwwseminarbaruslot2.php on line 37

    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in c:phpdev5wwwseminarbaruslot2.php on line 46

    Kuzie
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 125
    Age : 32
    Location : eVeRyWhErE
    Registration date : 13/02/2009

    Re: Coding search php mysql

    Post by Kuzie on Sat Mar 21, 2009 6:54 pm

    error ni kat form mana? form update tu saya just add calendar dgn link form awak ke javascript tu jek..coding lain saya xsentuh...

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Sun Mar 22, 2009 11:00 am

    coding nie
    Code:


    <?php

    $room=$_POST[room];
    $date=$_POST[date];
    $time=$_POST[time];

    $db = mysql_connect("localhost","","");
    if (!$db)
      {
      die('Could not connect: ' . mysql_error());
      }


    //Convert Date "/" kepada "-"
    $format = '%Y-%m-%d';
    $date =strtotime($date);
    $date = strftime($format, $date );

    if ($Select1 =='Morning')
    {
    $Season1 = "09:00:00";
    $Season2= "11:00:00";
    }
    if ($Select1 =='Afternoon')
    {
    $Season1 = "11:00:01";
    $Season2 = "13:30:00";
    }
    if ($Select1 =='Evening')
    {
    $Season1 = "14:00:01";
    $Season2 = "17:30:00";
    }

    $maklumat = mysql_query("SELECT * FROM code,date,time,room,title,name from student student where room = '$room' and Date = '".$date."' and Time BETWEEN '".$Season1."' AND '".$Season2."' ");

    echo
          "<table class=mediumtxt width=771 align=center border=1>";
    echo "<tr><td><b>PaperCode</b></td><td><b>Date</b></td>
    <td ><b>Time</b></td>
    <td><b>Room</b></td>
    <td><b>Conference Title</b></td>
    <td><b>Presenter Name</b></td></tr>";
    while ($myrow = mysql_fetch_assoc($maklumat)) {

    echo "<tr><td>";
    echo $myrow["code"];
    echo "</td><td>";
    echo $myrow["date"];
    echo "</td><td>";
    echo $myrow["time"];
    echo "</td><td>";
    echo $myrow["room"];
    echo "</td><td>";
    echo $myrow["title"];
    echo "</td><td>";
    echo $myrow["name"];
    echo "</td></tr>";
    }
    echo "</table></div>
          </div>
          </div>
          </div>
          </div>
          </div>
          </div>
          </div>
          </div>
          ";
    mysql_close($con);
    ?>

    Farlee
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 38
    Age : 33
    Location : Kuala Lumpur, Kuala Terengganu (Malaysia)
    Job/hobbies : Looking at Computer
    Registration date : 16/03/2009

    Re: Coding search php mysql

    Post by Farlee on Sun Mar 22, 2009 2:10 pm

    syira86 wrote:
    . . . . .
    $maklumat = mysql_query("SELECT * FROM code,date,time,room,title,name from student student where room = '$room' and Date = '".$date."' and Time BETWEEN '".$Season1."' AND '".$Season2."' ");
    . . . . .
    1. ada dua student tu.... padam salah satu, setel dua error!! Smile
    2. kenapa nk pakai 'dot' (.) dekat variable mcm $Season1, $date & $Season2? letak '$Season1' je, ok dh!
    Don't be too advanced and complicated, simple2 dh la.

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Coding search php mysql

    Post by syira86 on Sun Mar 22, 2009 4:48 pm

    salam..dah padam student pn..ade error jg la

    Sponsored content

    Re: Coding search php mysql

    Post by Sponsored content Today at 4:15 pm


      Current date/time is Tue Dec 06, 2016 4:15 pm