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

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #16 (permalink)  
Old 11-07-2003, 08:48 AM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
I don't think there's anything wrong with that script. Have you edited pesakit.php? Because if you haven't, that's why it doesn't insert. The script that I gave you (the modified script) doesn't have a insert routine.

BTW, did you write the script yourself? Because, there are easier ways to do what your trying to do. I mean with your

HTML_Head();
HTML_Form();
HTML_Foot();

You can just make those pure HTML, it'll be easier too. You should only use functions like that when you want a standard but dynamic header and footer on multiple pages.

The insert routine shouldn't be to hard to do, so I wish you the best of luck on your assignment.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 11-07-2003, 08:56 AM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
Just to give you a kick start add:
PHP Code:
$SQL_Exec_String="Insert Into maklumatPesakit (Bil,Nama,noTelefon,RN,Lokasi,Umur,Cardiologist,Jantina,jenisAkaun,provisionalDiagnosis,Prosedur,Findings,Plan) values ('$bil','$Nama','$noTelefon','$RN','$Lokasi','$Umur','$Cardiologist','$Jantina','$jenisAkaun','$provisionaldiagnosis','$Prosedur','$Findings','$Plan')";
$cur=odbc_exec($cnx$SQL_Exec_String);
if(!
$cur){
Error_handler("Error in odbc_exec(no cursor returned)",$cnx);

To your pesakit.php (This part was taken from your old script)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 11-07-2003, 09:11 AM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 118
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
this is not right...

sufyan,

personally I do not agree that you rewrite the script for her. It is her job to do it.

What we can do is point out the error and guide her to the right path, but not do the job for her.
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 11-07-2003, 10:14 AM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
Hi,

That's true lcf, but from the script she gave, it's a bit difficult to explain how she could fix her code without changing a large chunk of it. Her script had a lot of redundant code. I'm not saying that it's wrong or anything. A programmer has the right to program how he or she want and I have no right to say anything about it. But from looking at this code I know she doesn't know it that well, in fact, I think the code is just a copy-and-paste script taken from somewhere.

I modified the script to make it as simple as possible. She can use the script like that, but I also hope that she learns from what I gave her. Hopefully, with that simple script, she will be able to expand her knowledge, get to know the basics well and in the future, be able to use that knowledge to stand up for herself.

I will help anyone who asks for help, especially those who are trying to learn - but I won't help those who ask me to do something and expect me to do something for them without them at least putting their own effort into it.

From experience, I know that this topic, interfacing PHP with Access is not an easy task. I did this once for one of my projects, but I ended up abandoning the project because I found problems that were to tedious to fix.

My intention was to pass the knowledge and for her to learn. I'm not doing the work for her. Please don't misinterpret that.

The job of re-writing the script only took about 30-45mins. That time would be much less than to tell her to do this and that, and when it doesn't work (and she starts pulling her hair out), she comes back, posts another problem (by then, it probably gets even more complicated) and then give we her another hint. That would take too much time and it wouldn't be worth it. It would waste a lot of her time, and it would waste a lot of mine too. So instead of taking days to solve a problem why not just cut to the chase and solve the problem in 30 minutes?

I know what I did could be considered wrong (because it's for her practical), but if she wanted help - guidelines, she could just go to google and search for guides or tutorials.

Justification of the design. When I re-wrote the script, I just got a template (that I made for a project I was doing), it has the same format that could be used for this, so I just used it. Permission is granted (to anyone) to use the design as is or modified, but it would be better if she used her own creativity and made her own design. The design wasn't anything special either, so it's no big deal.

As for my last post, (about the kick start) that code was just a copy-and-paste of her original code.

My intention was to give a guide (in the form of a working script), so that it would be easier for her to learn, and not to do the work for her. She will still have to modify the script to her requirements.

But thanks lcf for bringing this up. But like I said, if anyone asks me for help, I will do my best to help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 11-07-2003, 10:43 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
pls....jgn gaduh pasal ni,ok...
saya just asking....
but,im still try my best to do my job...
and try to settle it with some guidelines from mr.sufyan...
plss....saya hanya budak yg baru blajar...
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #21 (permalink)  
Old 11-07-2003, 10:59 AM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
Siapa yang gaduh? Ade orang gaduh ke?

I'm sure that what lcf said was his honest, sincere opinion and I respect other people's comments. I have justified my side, so I have no problems with it.

This shouldn't and won't result in any fights. Jgn risau...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #22 (permalink)  
Old 05-08-2003, 11:11 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
mr. sufyan..
thanks a lot 4 helping me in doing my system ....
tp....menyedihkan...kena buat balik sistem..hehehe..
my user said the interface little bit complicated...
dia just nak interface tu kelihatan sama mcm interface masa dia guna manual...so..kena start dr awal balik....aper nak buat...hihihi..

now..i decide to use mysql 4 my database...
tp...macamana nak setkan password?saya search kat internet...dan jumpa cara nak setkan..
tp,bila try guna mysql.exe, ada error...
what should i do???

mysql -u root -p
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #23 (permalink)  
Old 05-08-2003, 04:18 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
Ic...

For setting the password, if your running it locally, it won't be a big problem if you dont have a password. But try this anyway:

From your mysql/bin cmd prompt try:
mysqladmin -u <username> password <newpassword>

eg. mysqladmin -u root password aBc123
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #24 (permalink)  
Old 05-08-2003, 04:27 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
still got an error...

ERROR 1064: you have an error in your SQL syntax near 'mysqladmin -u .............................................'

one more question...
maybe little bit fool question 4 all of us here....
tp..saya still nak tau...
boleh ke nak buat relationship (sama mcm dlm access) kalau kiter guna mysql as database?


**still blajar**
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #25 (permalink)  
Old 05-08-2003, 07:48 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
Are you running mysqladmin from a command line or within a script? mySQL has to be running, and you must run mysqladmin from the command line.

e.g.:
C:\mysql\bin>mysqladmin -u root password aBc123

For your second questions, you can have relationships (linked tables) in MySQL, but I think you won't really need to worry about that for now. It would be easier for you to do relationships within SQL syntax for now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #26 (permalink)  
Old 06-08-2003, 09:16 AM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 118
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
sufyan, thanks for the reply

"if anyone asks me for help, I will do my best to help"
Well, i think we have same point of view.
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #27 (permalink)  
Old 06-08-2003, 09:22 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
my boss said that...
masa dia buat programming dulu...
dia tak tekankan pasal relationship..tp..tekankan kat coding dlm php utk panggil data dr database...
kalo org tak expert mcm saya,should i follow his rules?
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #28 (permalink)  
Old 06-08-2003, 02:39 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
Yes... You should follow what your boss said. Calling data from multiple tables with a php is easier than to use linked tables (relationships) with MySQL.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #29 (permalink)  
Old 06-08-2003, 02:46 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
thanks a lot 4 your opinion....
i really appreciate it...
nanti,kalo ada masalah lagi,boleh tanya lagik tak??
cam asyik tanya soalan jer...takut mr. sufyan buhsan nak jawab soalan yg common cam tu...
sorry...tp..saya betul2 nak blajar....
__________________
aku seadanya...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #30 (permalink)  
Old 06-08-2003, 02:52 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
No problem... Ask as much as you want. This is a place to share knowledge and opinion. If I can't answer your question, I'm pretty sure there's someone else here who can.
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 Search this Thread
Search this Thread:

Advanced Search
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

BB 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 03:12 AM. Powered by vBulletin® Version 3.7.3
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.