alexviii
Aug 22 2006, 03:53 PM
Hy everyone! I am moderately familiar with PHP and have been using it for a couple years for various different things. Basic information about my system: PHP 5 MySQL 4.1 Apache Windows XP Pro I'm using PHP/MySQL for a web-based server and have an ODBC set up in my office. I'm running into some problems using the ODBC code as opposed to the MySQL code in some scripts I have been writing. **In my scripts I use an ODBC database converter found in a tutorial on phpfreaks here http://www.phpfreaks.com/tutorials/61/2.php , contains connection string also. Also using MySQL Query Builder for testing SQL syntax. What i'm attempting to do at this point is make 3 scripts that allow me to input data specific to a patient, call the rest of the patient's information from my database, and update the additional information. This first script makes a form where I input information patients at the office, Patient ID in this case. This works fine, and after this form the form posts to my next script, displayrecord.php. After inputing data, the script should call the particular record and display the rest of the information **code to create the form that accepts the patient id and displays the record from the patient table CODE <p> </p> <form name="updateform" method="post" action="displayrecord.php"> <table width="250" border="0" align="center" cellpadding="3"> <tr> <td colspan="2"> <center><b>Enter Patient ID</b></center> </td> </tr> <tr > <td width="100"> <center>Patient ID</center> </td> <td width="150"> <input type="text" name="ptid"> </td> </tr> <tr> <td colspan="2" > <center> <input type="submit" name="Submit" value="Submit"> </center> </td> </tr> <? require_once(odbc.php); ?> **PHP script to display the record and accept the updates for the existing record** I run into problems as soon as I call displayrecord.php, i'm pretty sure my SQL syntax is correct, but it could be a problem with the form construction. The output will show the beginning of the form, but no other fields of the form. I feel it doesn't work because of naming/calling the fields from the array for the form inputs. Here is le code: CODE <p> </p><form name="displayrecord" method="post" action="updaterecord.php"> <table width="250" border="1" align="center" cellpadding="3"> <tr> <td colspan="2"> <div align="center"><b>Update Patient Information</b></div> </td> </tr>
<?php require_once('odbc.php');
$query="SELECT * from tblPatient WHERE PatientID='" .$PatientID ."'"; $varquery=odbc_exec($odbc, $query) or die (odbc_errormsg()); if($record=odbc_fetch_array($varquery)) { echo "<tr> "; echo " <td width=\"100\"> "; echo " <div align=\"right\">Patient ID </div>"; echo " </td>"; echo " <td width=\"150\"> "; echo " <input type=\"text\" name=\"PatientID\" value=\"".$record["PatientID"]."\">"; echo " </td>"; echo " </tr>"; echo "<tr> "; echo " <td width=\"100\"> "; echo " <div align=\"right\">LName </div>"; echo " </td>"; echo " <td width=\"150\"> "; echo " <input type=\"text\" name=\"LastName\" value=\"".$record["LastName"]."\">"; echo " </td>"; echo " </tr>"; echo " <tr> "; echo " <td width=\"100\"> "; echo " <div align=\"right\">FName</div>"; echo " </td>"; echo " <td width=\"150\"> "; echo " <input type=\"text\" name=\"FirstName\" value=\"".$record["FirstName"]."\">"; echo " </td>"; echo " </tr>"; echo " <tr> "; echo " <td width=\"100\"> "; echo " <div align=\"right\">Address </div>"; echo " </td>"; echo " <td width=\"150\"> "; echo " <input type=\"text\" name=\"ADDRESS1\" value=\"".$row["ADDRESS1"]."\">"; echo " </td>"; echo " </tr>"; echo "<tr> "; echo " <td width=\"100\"> "; echo " <div align=\"right\">Phone </div>"; echo " </td>"; echo " <td width=\"150\"> "; echo " <input type=\"text\" name=\"HM\" value=\"".$row["HM"]."\">"; echo " </td>"; echo " </tr>"; echo " <tr> "; echo " <td colspan=\"2\"> "; echo " <div align=\"center\"> "; echo " <input type=\"submit\" name=\"Submit\" value=\"Submit\">"; echo " </div>"; echo " </td>"; echo "</tr>"; } ?> This last script accepts the record entered by the end user and updates the record in the MySQL table. CODE <?php require_once('odbc.php');
$query="UPDATE tblPatient SET ADDRESS1=\"". $ADDRESS1 . "\" , HM=\"".$HM."\" WHERE PatientID=\"".$PatientID."\""; $varquery=mysql_query($query); if (!$varquery) { die(" Query execution failed!!!<br>"); } else { echo "<table border=\"0\" align=\"center\" cellspacing=\"1\" cellpadding=\"5\" width=\"300\">"; echo " <tr> "; echo " <td colspan=\"2\"> "; echo " <center><b>".odbc_affected_rows()."record is updated successfully</b></center>"; echo " </td>"; echo " </tr>"; echo " <tr> "; echo " <td width=\"100\"> "; echo " <div align=\"right\">Patient ID</div>"; echo " </td>"; echo " <td width=\"200\">".$PatientID. "</td>"; echo " </tr>"; echo " <tr> "; echo " <td width=\"100\"> "; echo " <div align=\"right\">Last Name</div>"; echo " </td>"; echo " <td width=\"200\">".$LastName. "</td>"; echo " </tr>"; echo " <tr> "; echo " <td width=\"100\"> "; echo " <div align=\"right\">First Name</div>"; echo " </td>"; echo " <td width=\"200\">".$FirstName. "</td>"; echo " </tr>"; echo " <tr> "; echo " <td width=\"100\"> "; echo " <div align=\"right\">Address</div>"; echo " </td>"; echo " <td width=\"200\">".$ADDRESS1. "</td>"; echo " </tr>"; echo " <tr> "; echo " <td width=\"100\"> "; echo " <div align=\"right\">Phone</div>"; echo " </td>"; echo " <td width=\"200\">".$phone. "</td>"; echo " </tr>"; echo " <tr> "; echo " <td colspan=\"2\"> </td>"; echo " </tr>"; echo "</table>"; } ?> Any and all input is greatly appreciated. If you feel I am doing something a really stupid way, please let me know.
Reply
Similar Topics
Keywords : odbc, form, problems
- Having Problems Connecting To The Internet Etc. On Another Laptop
(0)
Download Statusbar Extension For Firefox Causing Problems
(2) I was just wondering if anyone was sharing the same problem. And yes, I intend to send some
correspondence to see if I can get an answer as to why this happens. After installing the Download
Statusbar extension for Firefox thanks to SM's Look-Like-Chrome-with-Firefox thread, I
immediately loved how the annoying download status dialog stopped popping up with everything from
program downloads to saving pictures. Lately, I've been saving a lot of awesome pictures from
PixDaus . (I totally recommend that anyone go visit the site, as it has some inspiring and outst....
Submitting A Form In Flex (follow Up Of Sm's Tut)
(2) Now Saint Michael made an excellent 3 part tutorial that explains how to make a form HERE So if
you need to design a form follow his nice tutorial. He did however mention he didnt know (yet) how
to submit a form, so i did some searching last night and made my form submit to a PHP file and this
is how its done (roughly, ive only had flex since last night so expect problems! My form is
designed as an email contact form but at the moment because i dont have a local mail server
configured im using the fwrite functions in PHP to illustrate that it works and to save the....
Design A Contact Form In Flex Part 3
(2) Design A Contact Form In Flex Part 3 Hopefully you have able to get a grasp on my first tutorials
on how to design a flex form and then be able to stylize it with CSS. So now on to set up your form
to validate and of course being able to reset your form as well., and before we get to the actual
coding I break down the tags that will be used in this tutorial and what their roles are. Of course,
since my newbieness really starts here I try my best to explain these tags. The first tag I will
cover for setting up the validation is the tag, and since I don't underst....
Problem With The Trap17 Forum
Inconsistent links and problems with "Latest Activity" (4) Hi, I have noticed a bit of a problem with the forums here on Trap17. I don't know if this is a
problem with the Trap17 implementation, or with Invision Power Board in general, or with a mod that
is running on the forums here, and I'm sure that someone smarter than me can isolate the source
of the problem. What I have noticed firstly is that the link that is generated in the top right
corner of a post within a thread, the link to that particular post (I'll call that the linkback
link), sometimes links to the post itself, but often just links to the thread. T....
Design A Contact Form In Flex Part 2
(0) Design A Contact Form In Flex Part 2 I hope that you learn a little bit of the Flex format with my
first tutorial because that was the easy stuff until you get to the actual programming such as
ActionScript and any other languages. Of course, I think this is by far the easiest part of
designing forms or applications and that is using CSS. I will like to point out that CSS in Flex is
a enigma and I will tell you why, because CSS in flex acts like regular CSS in html however it is
very limited in what you can use and yet CSS in Flex is very complex because of how you ca....
Print Server Help
problems with router/print server (0) Hi, wondering if someone can help me out with this... I'm trying to set up a router with print
server capabilities in my office. The router/switch has four LAN ports and a WAN port to connect it
to the modem/gateway (sorry if using wrong terms...). It also has a USB port where a printer can be
hooked up. Now, if I connect the WAN port to the corporate LAN network and a PC to one of its LAN
ports the router will assign a "subnet IP address" (e.g. 192.168.0.x) to the PC and the PC will thus
be able to access the internet and also to print, so far so good /wink.gif"....
About Posting Form
(2) Hi i had just register for free account and just think that why it is so important to post form for
free hosting....
Text Size In "fill-in" Form Blanks
How do you change the size of the text in the fill in form entry boxes (2) Thanks for all the help on my previous question about adding an address to a "Submit" button.
I've also been able to add a "print page" button through the help from group members. I now have
another question. I've created a form using the Input commands that ask for name, address,
state, etc. My computer is set to use 12 point text on a 800 x 600 screen resolution. When I hit the
print screen button, everything is printed out fine, but I would like the information that people
will be entering into the various boxes to be of a larger or bolder style. The whole re....
Psychosomatic Mental Problems
This is an article about diseases that is caused by Mental Problems (3) Psychosomatic is a mental disorder. Parents should notice that is their child develop psychosomatic
disorder to prevent future problems. Psychosomatic is a problem that is caused by stress, sadness,
grieve or cannot accept own self. The sadness, grieve, stress, anxiety that comes from mind is
actually affecting the body growth. Psychosomatic that is caused by sadness/grieve and the patient
hurt the heart, feels very heart, can actually causes heart attack in the old age. Psychosomatic
also causes problems like psoriasis, eczema, stomach ulcers, high blood and pressure. ....
Design A Contact Form In Flex Part 1
(0) Design a Flex Form Part 1 Well this is my first tutorial on Adobe Flex 3 which is a great program
if you’re interested in designing applications for the web 2.0 era. Adobe flex is the way to
go as it combines several different programming languages in order to make the most out of this
program. This includes HTML, CSS, XML, PHP/MySQL, XML, ActionScript, Ruby on Rails and ASP and this
is all possible by the use of MXML or Magic eXtensible Markup Language because it is a user
interface markup language. My three part tutorials for this form include designing the f....
Panasonic Lumix - Problems With Movie Files
troubles managing (renaming, moving, deleting) movie files from the ca (0) I've recently bought a Panasonic Lumix TZ3, the one with a wideangle to telephoto lens (10x zoom
from 28mm to 280mm equivalent) and I am very satisfied with the overall performance. Obviously I
didn't buy the camera because of the movie features but occasionally I do take some short clip
or use the "picture with audio" to comment on a photo, these functions are pretty easy to use and
the quality of the video is reasonable. The movie files (or the audio attached to a picture) get
saved in Jpeg Motion Picture format, generating a .MOV file which appears on the me....
Host Problems
Need some help (7) Hey, recently ive applied and been accepted for a host. Now, i set up an account and then tried to
get to the access panel.. Didnt worked... I thought it might be because of my domain, so i got
another 15 credits and transferred the domain.. Now, i try clicking on "cPanel Login", but it wont
even open it.. It just says "error by loading page"... whats going ? ive lost 45 credits already
/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" />....
Perl For Automated Web Form Search
(1) Hi all, I'd like to write a script to automate a search in order to collect data from an online
database. The database is an archive of newspaper articles. The search is for certain words/text. It
is searchable via a form only. The rub is that only a small portion (a month) at a time is
searchable. I need to search every day for 50 years or so. Manually, this would take a considerable
amount of time. I'm thinking of using perl or ruby or something similar. I am an absolute
beginner with scripting and haven't done much formal learning in the subject since a ....
I Need Some Help With Flash And Div Overlay
using wmode in IE problems (5) Hi guys, I have a problem with one of my designs at the moment. Here's the problem: I have a
flash game in the middle of a page. However, the site navigation has dropdown menus that go on top
of the flash. Now, the navigation works if I use "wmode = transparent" or "wmode = opaque" in the
flash code. Yet, there is another problem: In Internet Explorer (I'm running version 7) the
arrow keys "up" and "down" in most flash games will not work properly. Instead, they will make the
page scroll up and down, even if the flash file has focus. This situation does not exi....
Updating Website, Ftp Problems
(6) 2 problems! a) how do i update my website??? like if i make changes to the code of say my
index.html page, how do i make these changes take place on the website online?? /cool.gif"
style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> how come my ftp uploads my
files to a file under my public_html folder but also under a folder with my user name
(public_html/username ) ??? this makes it so the url of my site isnt www.abc.trap17.com anymore
but www.abc.trap17.com/username/ ---- this makes no sence!!....
Install And Uninstall Problems
Mozilla Thunderbird will not allow one or the other. (4) Hi, I tried to update Mozilla Thunderbird (email client) from version 2.0.04 to 2.0.012, especially
because the older version was not functioning 100 % anymore. However, when trying to install
2.0.0.12, a few seconds after the install start screen I get the following window that pops up:
QUOTE "--------------------------- Mozilla Thunderbird Setup --------------------------- Error
opening file for writing: C:\Program Files\Mozilla Thunderbird\mozMapi32.dll Click
Retry to try again, or Cancel to stop the installation. --------------------------- Re....
Php Ftp Upload Form
Adding User Directory to PHP Upload Form - Help (1) Alright I am trying to have a PHP FTP Upload Form that allows the user to create the directory
folder for where they want to upload there files to. example: Main Directory: vainsoft.com There
directory: vainsoft.com/modeling or vainsoft.com/photography But I dont want them to be able to
upload things into the main directory, only sub-directories, is that possible with this coding that
I have: //uses $_FILES global array //see manual for older PHP version info //This
function will be used to get the extension from the filename function get_extension($fi....
My Problems Continue :(
(10) ok so yeah if you have read my other topics you now i love this girl who is one of my close friends
but she is going with this guy i hate...my one friend asked her what she saw in him and she said
that he is the only one that treats her like a girl, like she is supposed to be treated, he is nice,
funny and cares about her. This deeply hurt me :'( and to add to it, she told my friend that she
wasnt going to even hang out with us because me and all my friends hate her boyfriend...so i went
home and IMed her and asked her in the exact way my friend did and she gave me t....
Problems With The Sony Ericsson S500?
(9) Hey guys, I plan to buy the Sony Ericsson S500 soon. I've tried reading a few reviews and I
stumbled across a post which said that the keys of the S500 are cracking!!! Is that
true? Does anyone own the Se S500. I've already fallen in love with the phone and it would be
sad if the phone was defective!!! Heres a peek at the phone. You guys will fall in love
a well!!!! http://www.sonyericsson.com/spg.jsp?cc=GB&...p&pid=10854 Here are
some of the features that are unique to this phone: -- Lights very similar to the Nokia ....
What Is A Computer Form Factor
(1) As I began my hardware class in school I knew I was going to be learning some new stuff about a
computer that I never really thought about besides the fact I use one. Hopefully what I talk about
in this topic will help people get a better understanding of computer hardware, especially when
might want to build one by scratch. The form factor is used to determine what power supply,
computer cases and motherboards you can use when building a fully customized computer instead of
getting one pre-built; such as Dell, Apple, Sony, and Alienware. There are 6 form factors (in....
Connection Problems And High Ping Playing Battlefield 2
(17) Anyone know of a solution to the connection problems, lag issues and high ping that I have only
recently started having while playing BF2? My system is only 2 weeks old... AMD 4000+, Asus A8N SLI
Deluxe, SoundBlaster Audigy 4, EVGA 7900GS and to be honest the game play sucks. Constant
disconnects, sound hanging up like a stuck record, just prior to entering a game online. The first
time I try to join my regular server I get "there's a problem with your connection" and kicks
me. I try again and get in this time, then my ping goes crazy, sometimes up to 900 and then I ....
Razr Problems
Keypad Doesn't Work (19) Hello, Can anyone help me? I own a Motorola Razr V3 and the only key that works is the on off
button. I have never dropped it and i take excellent care of my phones. It was working fine for a
few months and one day it just stopped working. The screen still works and I can awnser phone calls
by opening the flip part, but I can't call anyone or text or anything that requires pushing a
button unless it is to turn it on or off. I hace looked online and it seemse other people ahve had
this problem but no one ever had a solution. Should I try to fix it? Should I ....
5.1 Sound System Problems
Need help... (8) I have a 5.1 Sound System. It works great in 2 channels but when I switch to 5.1 the subwoofer
ain't working. My motherboard has a nvidia 4 ultra chipset so it supports 5.1 configuration.
Also in nvidia mixer when I use sound test everything is great and I can hear the subwooofer working
as is should. But when I want to watch a movie or listen to music the subwoofer is as good as dead.
Can somebody help me? ....
Problems With Outlook Express
My email configuration isn't working (7) Does anyone have a clue as to why my outgoing email isn't working with Outlook express? I can
get incoming mail, but I'm getting an error when I try to send email. I followed the
configuration instructions, but it still isn't working correctly. I get an error everytime.....
Ie And Firefox Crash
Flash & Download problems (5) I have problems with both IE and Firefox. IE always crashes or freezes on me all the time. When I
can actually use it, it never displays flash. Like if somone has a flash animation in their banner
it just shows a still picture. I went into the internet options and enabled flahs and stuff and it
doesn't show the animation. I even got the newest version of Flash. Firefox doesn't crash as
much as IE but it does from time to time. I have ran spyware and virus software and nothing comes
up. I dunno what the problem is. Also, whenever I download something on IE or Fire....
Nokia 6600 Virus Problems
(13) I have some problems with my mobile phone (NOKIA 6600). I got a virus from someone via bluetooth
and it is ´killing´nokia. I tried F-secure protection but it isn't working. Please, help
me!....
Computer Problems
I need help please =( (20) please i need help, i cant reboot my ststem i think the hard drive is damge or something, i think
alot of .dll files are missing, also alot of registry files, this is a big mess please i dont know
what to do some programs of mine dont work.....
Guestbook (cgi-script) Problems
Do u know much bout chmod and cgi-cripts? (5) Hi! I'd like to make a guestbook with a cgi-script I found at Lissa Explains it All .
There were instruction bout how to install this gbook: click here QUOTE Active Guestbook
Unzip the file, you'll find 4 separate files: guestbook.cgi mail.gif url.gif readme.txt 1.
Open guestbook.cgi in a plain text editor like notepad. Find out your path to perl from your Web
host, and change the first line to reflect that. The default setting, #!/usr/bin/perl, usually
works for most servers. If not, you can try #!/usr/local/bin/perl. Save your changes. ....
Free Windowsxp Sp2 Cd From Microsoft
just fill the request form and recive it (13) microsoft offer 100% free windows xp sp2. just go to this link
http://www.microsoft.com/windowsxp/downloa...us/default.mspx and fill your address they will send
you the cd to you. I just recive the cd yesterday. /biggrin.gif' border='0'
style='vertical-align:middle' alt='biggrin.gif' /> I see new feature like directx 9c , WMP9 ,
firewall , and the one I like is popup blocker! /wink.gif' border='0'
style='vertical-align:middle' alt='wink.gif' /> PS. waiting for the cd about 1-2 week if you
write an exact address.....
Looking for odbc, form, problems
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for odbc, form, problems
*MORE FROM TRAP17.COM*
|
advertisement
|
|