+8
JebatDerhaka
BasicCX
kaizen
Arman
FryShadow
Haibara Ai
slaughters
syira86
12 posters
Coding search php mysql
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°51
Re: Coding search php mysql
ooppss..sorry pasal SQL tu...Xcomplicated sangat pun kan..sorry yek..thanks Farlee sbb bagitau..Syira copy paste error tu pastu bagitau error kat mana yg xok...
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°52
Re: Coding search php mysql
- Code:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in c:\phpdev5\www\seminarbaru\conference_slot2.php on line 44
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in c:\phpdev5\www\seminarbaru\conference_slot2.php on line 70
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°53
Re: Coding search php mysql
try ni plak
- 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_array($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);
?>
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°54
Re: Coding search php mysql
- Code:
//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";
}
nie code nie kne set kt dtabe ker.....
Farlee- Ahli Baharu
- Gender : Male Number of posts : 38
Age : 40
Location : Kuala Lumpur, Kuala Terengganu (Malaysia)
Job/hobbies : Looking at Computer
Registration date : 16/03/2009
- Post n°55
Re: Coding search php mysql
takder nama user utk MySQL ke, kuzie?Kuzie wrote:....
$db = mysql_connect("localhost","","");
....
Lagipun kalu syira berdepan dgn masalah ini, kemungkinan nama user atau password database syira lain dgn kuzie.
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°56
Re: Coding search php mysql
- Code:
//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";
}
nie code nie kne set kt dtabe ker.....
Farlee- Ahli Baharu
- Gender : Male Number of posts : 38
Age : 40
Location : Kuala Lumpur, Kuala Terengganu (Malaysia)
Job/hobbies : Looking at Computer
Registration date : 16/03/2009
- Post n°57
Re: Coding search php mysql
Takder kaitan dengan database, hanya nak umpukkan nilai dalam variable parameter je...
dan penyata if..else tu memuat perbandingan sama ada ianya padan dengan nilai dalam parameter atau tidak.
dan penyata if..else tu memuat perbandingan sama ada ianya padan dengan nilai dalam parameter atau tidak.
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°58
Re: Coding search php mysql
Farlee wrote:takder nama user utk MySQL ke, kuzie?Kuzie wrote:....
$db = mysql_connect("localhost","","");
....
Lagipun kalu syira berdepan dgn masalah ini, kemungkinan nama user atau password database syira lain dgn kuzie.
Xtahu la plak Farlee..Yg atas tu aku xtukar rasenye...
Farlee- Ahli Baharu
- Gender : Male Number of posts : 38
Age : 40
Location : Kuala Lumpur, Kuala Terengganu (Malaysia)
Job/hobbies : Looking at Computer
Registration date : 16/03/2009
- Post n°59
Re: Coding search php mysql
Daripada error yg syira bg nih, sy rasa database x di'connect', mcm masa connect tu, ada something wrong. Kalu nk tau error ke x, enable kan MySQL server, bukak command prompt, isi direktori sampai ke folder adanya mysql.exe kemudian taip -> "mysql -u root" (default). Kalu bleh masuk cara 'default', kena ubah koding kat sini ->syira86 wrote:Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in c:\phpdev5\www\seminarbaru\conference_slot2.php on line 44
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in c:\phpdev5\www\seminarbaru\conference_slot2.php on line 70
- Code:
mysql_connect(localhost,"root","");
- Code:
mysql_select_db("seminar");
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°60
Re: Coding search php mysql
salam..sy tnye tutor ..die utk coding sy kne letak AND sttment jer..tp tdi die cube wat jg tp stil xdpt la...
coding awk bg 2 stil ade error ditmpt yg sma wlaupn dah check "seminar" n ltk "localhost","root","".......btl2 rase tertekan nie..tgal 2mgu jer ade nk present..hhuuuhuh
adakah sebab sy gune php dev5...cz ade error???
coding awk bg 2 stil ade error ditmpt yg sma wlaupn dah check "seminar" n ltk "localhost","root","".......btl2 rase tertekan nie..tgal 2mgu jer ade nk present..hhuuuhuh
adakah sebab sy gune php dev5...cz ade error???
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°61
Re: Coding search php mysql
Senang citer camni laa...awak zipkan folder System sekali dgn database hantar kat saya..hehehe
Sekian terima kasih...
Sekian terima kasih...
Last edited by Kuzie on Thu Mar 26, 2009 9:52 am; edited 2 times in total
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°62
Re: Coding search php mysql
salam..sy dah antar folder sy dlm bntuk zip..awk check la..dpt ke x..thnx ye awk
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°63
Re: Coding search php mysql
Folder sudah sampai dgn selamatnye....nanti hamba perhatikan.....doa2 kan agar hamba dapat menyelesaikan dalam masa yg terdekat....
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°64
Re: Coding search php mysql
Satu lagi syira...mana satu form 1st nak masuk ni...???SQL database letak kat mana???
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°65
Re: Coding search php mysql
Syira...Sebenarnye file database mysql tu ada dalam awak punye folder yg awak install MySQL...Basic file dalam tu seperti dibawah :
Nama Folder = nama database yg awak create...
Contoh path : C:\....\mysql\mysql5.0.51b\data\login
Dalam folder data tu mempunyai semua maklumat database yg awak pernah create.
login tu databas yg di create:
Dalam folder tu basic mmg ade 3(tambah 1 table yg awak create) contoh file tu seperti dibawah:
active_users.frm
db.opt
user.frm
Sekiranye awak create satu lagi table bertambah la satu lagi file dalam folder tu.
Yg paling senang nak tengok kalau awak install WAMP( Window Apache MySql Php). Software ni mmg dah ada Apache, MySQL dan PHP didalam.Just install sahaja dan database MySQL boleh dilihat secara terus meaning ada interface bukan coding dalam MS-DOS.
Awak boleh download file die kat sini WAMP.
Saya harap awak boleh send file database tu sekali dgn system dan zipkan...
Nama Folder = nama database yg awak create...
Contoh path : C:\....\mysql\mysql5.0.51b\data\login
Dalam folder data tu mempunyai semua maklumat database yg awak pernah create.
login tu databas yg di create:
Dalam folder tu basic mmg ade 3(tambah 1 table yg awak create) contoh file tu seperti dibawah:
active_users.frm
db.opt
user.frm
Sekiranye awak create satu lagi table bertambah la satu lagi file dalam folder tu.
Yg paling senang nak tengok kalau awak install WAMP( Window Apache MySql Php). Software ni mmg dah ada Apache, MySQL dan PHP didalam.Just install sahaja dan database MySQL boleh dilihat secara terus meaning ada interface bukan coding dalam MS-DOS.
Awak boleh download file die kat sini WAMP.
Saya harap awak boleh send file database tu sekali dgn system dan zipkan...
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°66
Re: Coding search php mysql
Interface boleh tengok kat sini...
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°67
Re: Coding search php mysql
Hi Syira...semua dah siap...xpayah tukar pape dalam database..Ignore jek pasal tukar2 dalam database sebelum ni..guna database asal awak..ok....hope xpayah muram2 dah..smile alwayyzzz
Ni coding untuk MAIN.php
Ni coding untuk MAIN.php
- Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Main</title>
</head>
<body bgcolor="#CC9900">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="932" height="771">
<!-- MSTableType="layout" -->
<tr>
<td valign="top" colspan="2" height="302">
<!-- MSCellType="ContentHead" -->
<div style="position: absolute; width: 672px; height: 128px; z-index: 2; left: 46px; top: 144px" id="layer2">
<b><font face="Goudy Old Style" size="7">
<marquee scrollamount="7" behavior="alternate" scrolldelay="93">INFORMATION TECHNOLOGY CONFERENCE INFORMATION TECHNOLOGY CONFERENCINFORMATION TECHNOLOGY CONFERENC</marquee></font></b></div>
<img border="0" src="Picture2.png" width="932" height="302"></td>
</tr>
<tr>
<td valign="top" height="419" bgcolor="#FBFBE4" align="center">
<?php
echo"<form method='POST' action='conference_slot2.php'>";
echo
"<select name='date'>
<option></option>
<option value=23/03/2009>23/03/2009</option>
<option value=24/03/2009>24/03/2009</option>
<option value=25/03/2009>25/03/2009</option>
</select>
<select name=time>
<option></option>
<option>9-11am</option>
<option>11-1.3</option>
<option>2-5.30</option>
</select>
<select name=room>
<option value=dkg4/1>dkg4/1</option>
<option value=dkg4/2>dkg4/2</option>
<option value=dkg4/3>dkg4/3</option>
</select>
<input type='submit' value='Search' name='B1'></form>";
?>
</td>
<td valign="top" rowspan="2" width="163" bgcolor="#FDFCE8">
<!-- MSCellType="NavBody" -->
<div style="position: absolute; width: 165px; height: 172px; z-index: 1; left: 787px; top: 614px" id="layer1">
<img border="0" src="images.jpg" width="180" height="169"></div>
<div style="position: absolute; width: 294px; height: 92px; z-index: 4; left: 62px; top: 554px" id="layer4">
<p align="left"><b>Hubungi Kami di:<br>
Urusetia SKPP09<br>
Kolej Sastera Dan Sains<br>
Universiti Utara Malaysia<br>
06010 Sintok<br>
Kedah</b><br>
<br>
Tel : 04-9283301 / 3313<br>
Faks : 04-9285766 / 3378<br>
</div>
</td>
</tr>
<tr>
<td valign="top" height="50" width="769" bgcolor="#A17416">
<!-- MSCellType="ContentFoot" -->
</td>
</tr>
</table>
</div>
</body>
</html>
Last edited by Kuzie on Thu Mar 26, 2009 12:16 am; edited 2 times in total
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°68
Re: Coding search php mysql
Ni untuk coding conference_slot2.php
- Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Conference</title>
</head>
<body bgcolor="#1B295B">
<div align="center">
<?php
$room=$_POST['room'];
$date=$_POST['date'];
$time=$_POST['time'];
//Convert Calendar "/" kepada "-"
//$format = '%Y-%m-%d';
//$date =strtotime($date);
//$date = strftime($format, $date );
?>
<table border="0" cellpadding="0" cellspacing="0" width="825" height="796" bgcolor="#808000">
<!-- MSTableType="layout" -->
<tr>
<td valign="top" msopnltype="NavBody" height="796" width="825" align="center" bgcolor="#BCEDF7">
<!-- MSCellType="ContentBody" -->
<img border="0" src="Uum.jpg" width="825" height="191"><p align="center"> </p>
<b><font size="6">Conference slot <?php echo $date; ?>
</font></b>
<p><b><font size="6">
<?php
// ** MySQL settings ** //
define('DB_NAME', 'db_myProject'); // The name of the database
define('DB_USER', 'root'); // Your MySQL username
define('DB_PASSWORD', ''); // ...and password. Leave it blank if you are using EasyPHP!!
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
$db = mysql_connect("localhost","root","");
if (!$db)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("seminar", $db);
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>";
$result = mysql_query("SELECT * FROM student where date='$date' AND time='$time' AND room='$room'");
while($myrow=mysql_fetch_array($result))
{
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>
";
?></font></b></td>
</tr>
</table>
</div>
* This conference slot will be change
</body>
</html>
Farlee- Ahli Baharu
- Gender : Male Number of posts : 38
Age : 40
Location : Kuala Lumpur, Kuala Terengganu (Malaysia)
Job/hobbies : Looking at Computer
Registration date : 16/03/2009
- Post n°69
Re: Coding search php mysql
Jadi mmg betul lah... key-in MySQL is a primary problem kenapa syira tu dapat error mysql_fect_assoc() adalah kosong isinya.
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°70
Re: Coding search php mysql
yup...primary problem boleh dikatakan yg tu..tapi minor problem pun banyak gak....tapi minor je...
cikdayah- Ahli Baharu
- Number of posts : 56
Registration date : 04/03/2009
- Post n°71
Re: Coding search php mysql
terernya kuzie ni siap boleh tolong tengok kan database lagi..boleh la blajar php dengan kamu nanti..saya budak baru belajar..
Kuzie- Ahli Baharu
- Gender : Male Number of posts : 125
Age : 40
Location : eVeRyWhErE
Registration date : 13/02/2009
- Post n°72
Re: Coding search php mysql
saya pun tgh belajar ni..sama2 la belajar...
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°73
Re: Coding search php mysql
salam..kuzie thnx byk2 ye..tp sy blum test lg coding cz ade midterm exam..ape2 nti inform awk blik if ade error...niway thnx byk2
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°74
Re: Coding search php mysql
n maaf la cz xreply mse awk tnye solan..sorry noh..ade periksa la
syira86- Ahli Baharu
- Gender : Female Number of posts : 108
Age : 38
Location : kedah
Job/hobbies : explore
Registration date : 04/03/2009
- Post n°75
Re: Coding search php mysql
tnx byk2 kuzie..coding awk bg xde error lgsung...jln dng ok.....skrg sy ade fkr nk bg lg web sy nie....ape pndapt if sy wat calerdar dlm web nie...nie sy bg image web kt internet..cmne nk wat????
[img][/img]
[img][/img]