Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 09-07-2003, 03:45 PM
spicy_girl's Avatar
Novice Webmaster
 
Join Date: Jul 2003
Location: aku org malaysia...
Posts: 45
Rep Power: 0
spicy_girl is on a distinguished road
Lightbulb kasi guideline sket....

mmm...
aku tgh buat satu sistem guna php ni...
skang ni,masalah aku...
aku tak reti nak buat search function utk cari maklumat patient yg ada dlm database...skang ni,aku guna access sbg d/base...
so,ada sesaper leh tlg tak???
plzz....bende ni ada kaitan ngan kelulusan aku utk praktikal ni...


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-07-2003, 05:45 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 93
sufyan is on a distinguished road
Hi,

If your trying to search for records in your database, just modify your SQL string... for example

PHP Code:
SELECT FROM patient WHERE PatientName LIKE '" . $_GET['PatientName'] . "%' ORDER BY PatientName ASC
So in an input box, if you input 'id' it will output all the record starting with 'id' that is, for example, idham or idros, etc.

By the way, from experience, you might run into a few problems interfacing PHP with Access - but it shoud be fine if your just going to add records to the database and viewing the records. You might be better of with MySQL if you're going to do anything more than that.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-07-2003, 08:05 AM
spicy_girl's Avatar
Novice Webmaster
 
Join Date: Jul 2003
Location: aku org malaysia...
Posts: 45
Rep Power: 0
spicy_girl is on a distinguished road
thanks a lot 4 your info....
aku rasa,membantu sket...
tapi,kalau aku nak search guna date appointment,tapi user kena masukkan 2. tarikh.....iaitu tarikh dari dan hingga tarikh.........
macamana yer.???
mmg pada mulanya,database,aku nak buat pakai mysql...
tp,memandangkan aku still tak expert pasal mysql,aku guna la apa yg ada dan aku reti...
thanks sufyan..
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-07-2003, 08:17 AM
spicy_girl's Avatar
Novice Webmaster
 
Join Date: Jul 2003
Location: aku org malaysia...
Posts: 45
Rep Power: 0
spicy_girl is on a distinguished road
soalan kedua...
kat bawah ni coding utk interface aku...
tp,maklumat dr.database tak kuar la kat paparan..
dia nyer table dan berapa rekod jer yg kuar...
ada sesaper leh bantu?

<?php
function HTML_Head(){
echo"
<HTML><HEAD>
<TITLE>Processing Form</TITLE>
</HEAD>
<BODY BGCOLOR=\"#ccccff\">";
}
function HTML_Foot(){
echo"</body></html>";
}
function Database_Entries($msg){
echo $msg;
}
function Output_Entries(){

$cnx=odbc_connect('Pesakit','root','');
if(!$cnx){
Error_handler("Error in odbc_connect",$cnx);
}
$cur=odbc_exec($cnx, "select Bil, Nama, noTelefon, RN, Lokasi, Umur,Cardiologist,Jantina, jenisAkaun, provisionalDiagnosis, Prosedur, Findings, Plan from maklumatPesakit");
if(!$cur){
Error_handler("Error in odbc_exec(no cursor returned)",$cnx);
}
echo"<table border=1><tr><th>Bil</th><th>Nama</th>".
"<th>NoTelefon</th><th>RN</th>"."<th>Lokasi</th><th>Umur</th>"."<th>Cardiologist</th><th>Jantina</th>"."<th>Jenis Akaun</th><th>Provisional Diagnosis</th>"."<th>Prosedur</th><th>Findings</th>"."<th>Plan</th></tr>\n";
$nbrow=0;

while( odbc_fetch_row($cur)){
$nbrow++;
$Bil= odbc_result($cur,1);
$Nama= odbc_result($cur,2);
$noTelefon= odbc_result($cur,3);
$RN= odbc_result($cur,4);
$Lokasi= odbc_result($cur,5);
$Umur= odbc_result($cur,6);
$Jantina= odbc_result($cur,7);
$jenisAkaun= odbc_result($cur,8);
$Cardiologist= odbc_result($cur,9);
$provisionalDiagnosis= odbc_result($cur,10);
$Prosedur= odbc_result($cur,11);
$Findings= odbc_result($cur,12);
$Plan= odbc_result($cur,13);

echo"<table border=1><tr><th>$bil</th><th>$Nama</th>"."<th>$noTelefon</th><th>$RN</th>"."<th>$Lokasi</th><th>$Umur</th>"."<th>$Cardiologist</th><th>$Jantina</th>"."<th>$jenisAkaun</th><th>$provisionaldiagnosis</th>"."<th>$Prosedur</th><th>$Findings</th>"."<th>$Plan</th></tr>\n";
}
echo"<tr><td colspan=2>$nbrow entries</td></tr></table>";
odbc_close($cnx);
}

function Error_Handler($msg,$cnx){
echo"$msg\n";
odbc_close($cnx);
exit();
}

function Enter_New_Entry($bil,$Nama,$noTelefon,$RN,$Lokasi, $Umur,$Cardiologist,$Jantina,$jenisAkaun,$provisio naldiagnosis,$Prosedur,$Findings,$Plan){
echo "BIL:$bil<br>";
$cnx=odbc_connect('Pesakit','root','');
if(!$cnx){
Error_handler("Error in odbc_connect",$cnx);
}

$SQL_Exec_String="Insert Into maklumatPesakit (Bil,Nama,noTelefon,RN,Lokasi,Umur,Cardiologist,Ja ntina,jenisAkaun,provisionalDiagnosis,Prosedur,Fin dings,Plan) values ('$bil','$Nama','$noTelefon','$RN','$Lokasi','$Umu r','$Cardiologist','$Jantina','$jenisAkaun','$prov isionaldiagnosis','$Prosedur','$Findings','$Plan') ";

$cur=odbc_exec($cnx, $SQL_Exec_String);
if(!$cur){
Error_handler("Error in odbc_exec(no cursor returned)",$cnx);
}

odbc_close($cnx);
}
$strOldEntries="Maklumat Dalam Pangkalan Data";
$strNewEntries="Maklumat Terkini Dalam Pangkalan Data";

HTML_Head();
Database_Entries($strOldEntries);
Output_Entries();
echo "BIL2:$bil";
Enter_New_Entry($bil,$Nama,$noTelefon,$RN,$Lokasi, $Umur,$Cardiologist,$Jantina,$jenisAkaun,$provisio naldiagnosis,$Prosedur,$Findings,$Plan);
Database_Entries($strNewEntries);
Output_Entries();
HTML_Foot();
?>
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-07-2003, 12:49 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 93
sufyan is on a distinguished road
Hi,

Could you give more information, such as a screen dump of your results (output) or the URL (if it's online) or even better, a copy of your database. This is because it would be easier to solve the problem if I or anyone else could simulate the problem.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 10-07-2003, 02:11 PM
spicy_girl's Avatar
Novice Webmaster
 
Join Date: Jul 2003
Location: aku org malaysia...
Posts: 45
Rep Power: 0
spicy_girl is on a distinguished road
ok...
ni database guna access...
http://www.geocities.com/shy_za19/sist.zip

hope u can help...
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 10-07-2003, 02:20 PM
spicy_girl's Avatar
Novice Webmaster
 
Join Date: Jul 2003
Location: aku org malaysia...
Posts: 45
Rep Power: 0
spicy_girl is on a distinguished road
ni print screen database yg telah dimasukkan..
tp,maklumat tak keluar pada screen..
http://www.geocities.com/shy_za19/interface.txt
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 10-07-2003, 05:04 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 93
sufyan is on a distinguished road
I have downloaded the database and I'm having a look at it now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 10-07-2003, 05:58 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 93
sufyan is on a distinguished road
Done...

Attached is the zip with the modified database and script... sorry I changed the script completely... but I think your script was too complicated... I simplified it a bit... You can modify it as you like.
Attached Files To view attachments your post count must be 0 or greater. Your post count is 0 momentarily.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 10-07-2003, 06:07 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 93
sufyan is on a distinguished road
Attached is a screen dump of what the output should look like.

Changes
* The only change I made to your database was I added Primary Keys to your two tables. I didn't find a use for your 'temujanji' table, so I just left it.
* I changed most of your script... The only part I copied was the database connection. This means that all the error handlers that you had in your previous script is no longer there... But those error handlers were useless. You header and footer functions were eliminated, I didn't see the point of that.
* I didn't know what the second half of your script was suppose to output, so I just left that out... but you should be able to modify the new script to your needs.

That's about it
Attached Images
To view attachments your post count must be 0 or greater. Your post count is 0 momentarily.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 11-07-2003, 08:00 AM
spicy_girl's Avatar
Novice Webmaster
 
Join Date: Jul 2003
Location: aku org malaysia...
Posts: 45
Rep Power: 0
spicy_girl is on a distinguished road
thanks a lot....
i really appreciate it....
*_*

u helps a lot...
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 11-07-2003, 08:08 AM
spicy_girl's Avatar
Novice Webmaster
 
Join Date: Jul 2003
Location: aku org malaysia...
Posts: 45
Rep Power: 0
spicy_girl is on a distinguished road
why this warning appear when i run ur pesakit.php?

Warning: Field index is larger than the number of fields in c:\phpdev\www\pesakit.php on line 88
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 11-07-2003, 08:14 AM
spicy_girl's Avatar
Novice Webmaster
 
Join Date: Jul 2003
Location: aku org malaysia...
Posts: 45
Rep Power: 0
spicy_girl is on a distinguished road
opss...
problem solve....
field tu lbh satu jer..
thanks a lot...
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 11-07-2003, 08:15 AM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 93
sufyan is on a distinguished road
Use the new database, because I added a primary key. The old database had only 13 fields - the new one has 14. That's why your getting that error.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 11-07-2003, 08:32 AM
spicy_girl's Avatar
Novice Webmaster
 
Join Date: Jul 2003
Location: aku org malaysia...
Posts: 45
Rep Power: 0
spicy_girl is on a distinguished road
opss...
other problem...
bila saya masukkan data dalam form,data tu tak post ke database...
kenape yer??
ni coding form saya...


<?php
function HTML_Head(){
echo"
<HTLM><HEAD>
<TITLE>Maklumat Pesakit</TITLE>
</HEAD>
<BODY BGCOLOR=\"#ccccff\">";
}
function HTML_Form(){
echo"
<FORM NAME=\"AccessInterface\"METHOD=post ACTION=\"pesakit.php\">
<strong></strong><h2><div align=\"center\"><font color=\"#000000\">MAKLUMAT PESAKIT</font></div></h2><br>
<strong>Sila Masukkan Maklumat Pesakit.</strong></div><br>
Nama : <input name=\"Nama\"TYPE=\"text\"SIZE=\"50\"><br><br>
No.Telefon : <input name=\"noTelefon\"TYPE=\"text\"SIZE=\"21\">
R/N : <input name=\"RN\"TYPE=\"text\"SIZE=\"26\"><br><br>
Lokasi : <input name=\"Lokasi\"TYPE=\"text\"SIZE=\"25\">
Umur : <input name=\"Umur\"TYPE=\"text\"SIZE=\"5\">
Cardiologist : <select name=\"Cardiologist\" SIZE=\"1\">
<option value=\"khalid yusof\">KY</option>
<option value=\"Tamil Selvam\">TSM</option>
<option value=\"CK yeo\">CKY</option>
<option value=\"Yoon Lai Lan\">YLL</option>
<option value=\"Shaiful\">SAY</option>
</select><br><br>
Jantina : <input type=\"radio\" name=\"Jantina\" value=\"Female\" checked>Perempuan<input type=\"radio\" name=\"Jantina\" value=\"Male\">Lelaki<br><br>
Jenis Akaun : <input type=\"radio\" name=\"jenisAkaun\" value=\"Private\" checked>Berbayar<input type=\"radio\" name=\"jenisAkaun\" value=\"Government\">Percuma<br><br>
Provisional Diagnosis : <textarea name=\"provisionaldiagnosis\"></textarea>
Prosedur : <textarea name=\"Prosedur\"></textarea><br><br>
Findings : <textarea name=\"Findings\"></textarea>
Plan : <textarea name=\"Plan\"></textarea><br><br>

<div align=\"center\"><input type=\"submit\" name=\"Submit\" value=\"Simpan\">
<input type=\"reset\" name=\"Reset\" value=\"Padam\"></div>
</form>
";
}
function HTML_Foot(){
echo"</body></html>";
}
HTML_Head();
HTML_Form();
HTML_Foot();
?>
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
chart... tolong sket... ridz_021 Website Programming 4 08-02-2006 01:19 PM
tlg check sket code ni prozone Website Programming 3 04-08-2005 10:17 PM
Nak tanya sket jepp Website Programming 2 18-03-2005 01:05 PM
tolong sket pasal style... YajivMalhotra Website Design 2 02-11-2004 12:40 PM
Boleh kasi komen web site ni tak ? myravens Websites Review and Suggestion 9 29-08-2003 06:55 PM



All times are GMT +8. The time now is 06:09 AM. Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.