Jump to content

imamac

Members
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

0 Neutral

About imamac

  • Rank
    New To The Neighborhood
  1. That was it....always something easy...
  2. Thanks, I'll give it a try!
  3. What you're referring to is the routine thing I've done a hundred times on many databases. But is asks for a root MySQL password in addition to that. I can post a link if it will help to see it.
  4. In one of my accounts, I am attempting to install Open EMR (healthwebit.com). In the installer PHP script it requires a root MySQL password in addition to the user login/password. It does note that generally it can be left black, but I get this when I do: openEMR Setup Step 3 Connecting to MySQL Server... Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in /home/******/public_html/openemr/openemr/setup.php on line 159 ERROR. Check your login credentials. Access denied for user 'root'@'localhost' (using password: NO) (#1045) Any suggestions here? Is there a "root" password? If so can it even be used on a shared server? Will TCH dash my dreams to pieces?
  5. I am also attempting to get this capability since enforcing referential integrity is sort of a good thing. However it is not available as a selection in phpMyAdmin and the option is greyed out when I use MySQL Administrator. Is there some sort of configuration setting I'm missing here?
  6. I guess that's what happens when the field is set to INTEGER instead of TEXT. Everything works now except the DATE field. I'll just stop posting now, since everytime I do I figure it out about 10 minutes later.
  7. Okay, I'm a dork. Somehow I deleted my IP address from the connections allowed to the database. It connects now and inserts data, just not all of it. Partial data from each of the form boxes, and then nothing for the two name boxes. Again, at least it's progress. (I put in a wildcard *temporarily* so if someone wants to try it you can.)
  8. Okay, I have an html form with an action of a php script that is supposed to insert the form data to the MySQL database. After submission, I get the confirmation message, but when I look at the database under the MySQL Administartor, it does not show any inserted rows. http://healthwebit.com/transplant/addpatient.html Below is the PHP: <?PHP error_reporting(E_ERROR | E_WARNING | E_PARSE); ini_set('track_errors', true); function DoStripSlashes($FieldValue) { if ( get_magic_quotes_gpc() ) { if (is_array($FieldValue) ) { return array_map('DoStripSlashes', $FieldValue); } else { return stripslashes($FieldValue); } } else { return $FieldValue; } } #---------- # FilterCChars: function FilterCChars($TheString) { return preg_replace('/[\x00-\x1F]/', '', $TheString); } if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ClientIP = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ClientIP = $_SERVER['REMOTE_ADDR']; } $FTGpatientssn = DoStripSlashes( $_REQUEST['patientssn'] ); $FTGlastname = DoStripSlashes( $_REQUEST['lastname'] ); $FTGfirstname = DoStripSlashes( $_REQUEST['firstname'] ); $FTGpatientfmp = DoStripSlashes( $_REQUEST['patientfmp'] ); $FTGsponsorssn = DoStripSlashes( $_REQUEST['sponsorssn'] ); $FTGdob = DoStripSlashes( $_REQUEST['dob'] ); $FTGsubmit = DoStripSlashes( $_REQUEST['submit'] ); # Include message in error page and dump it to the browser if ($ValidationFailed === true) { $ErrorPage = '<html><head><title>Error</title></head><body>Errors found: <!--VALIDATIONERROR--></body></html>'; $ErrorPage = str_replace('<!--VALIDATIONERROR-->', $ErrorList, $ErrorPage); $ErrorPage = str_replace('<!--FIELDVALUE:patientssn-->', $FTGpatientssn, $ErrorPage); $ErrorPage = str_replace('<!--FIELDVALUE:lastname-->', $FTGlastname, $ErrorPage); $ErrorPage = str_replace('<!--FIELDVALUE:firstname-->', $FTGfirstname, $ErrorPage); $ErrorPage = str_replace('<!--FIELDVALUE:patientfmp-->', $FTGpatientfmp, $ErrorPage); $ErrorPage = str_replace('<!--FIELDVALUE:sponsorssn-->', $FTGsponsorssn, $ErrorPage); $ErrorPage = str_replace('<!--FIELDVALUE:dob-->', $FTGdob, $ErrorPage); $ErrorPage = str_replace('<!--FIELDVALUE:submit-->', $FTGsubmit, $ErrorPage); echo $ErrorPage; exit; } #==================================================== # Dump field values to a MySQL table = #==================================================== $mysql_link = @mysql_connect("localhost", "????????????", "???????????"); if (mysql_errno() == 0) { @mysql_select_db("???????????", $mysql_link); } if (get_magic_quotes_gpc()) { $FTG_patientssn = stripslashes($FTGpatientssn); $FTG_lastname = stripslashes($FTGlastname); $FTG_firstname = stripslashes($FTGfirstname); $FTG_patientfmp = stripslashes($FTGpatientfmp); $FTG_sponsorssn = stripslashes($FTGsponsorssn); $FTG_dob = stripslashes($FTGdob); } else { $FTG_patientssn = $FTGpatientssn; $FTG_lastname = $FTGlastname; $FTG_firstname = $FTGfirstname; $FTG_patientfmp = $FTGpatientfmp; $FTG_sponsorssn = $FTGsponsorssn; $FTG_dob = $FTGdob; } if (mysql_errno() == 0) { $sqlcmd = sprintf("INSERT INTO `patients`(`patientssn`, `lastname`, `firstname`, `fmp`, `sponsorssn`, `dob`) VALUES('%s', '%s', '%s', '%s', '%s', '%s')", mysql_real_escape_string($FTG_patientssn, $mysql_link), mysql_real_escape_string($FTG_lastname, $mysql_link), mysql_real_escape_string($FTG_firstname, $mysql_link), mysql_real_escape_string($FTG_patientfmp, $mysql_link), mysql_real_escape_string($FTG_sponsorssn, $mysql_link), mysql_real_escape_string($FTG_dob, $mysql_link)); @mysql_query($sqlcmd, $mysql_link); } # Include message in the success page and dump it to the browser $SuccessPage = '<html><head><title>Success</title></head><body>Patient has been added.</body></html>'; $SuccessPage = str_replace('<!--FIELDVALUE:patientssn-->', $FTGpatientssn, $SuccessPage); $SuccessPage = str_replace('<!--FIELDVALUE:lastname-->', $FTGlastname, $SuccessPage); $SuccessPage = str_replace('<!--FIELDVALUE:firstname-->', $FTGfirstname, $SuccessPage); $SuccessPage = str_replace('<!--FIELDVALUE:patientfmp-->', $FTGpatientfmp, $SuccessPage); $SuccessPage = str_replace('<!--FIELDVALUE:sponsorssn-->', $FTGsponsorssn, $SuccessPage); $SuccessPage = str_replace('<!--FIELDVALUE:dob-->', $FTGdob, $SuccessPage); $SuccessPage = str_replace('<!--FIELDVALUE:submit-->', $FTGsubmit, $SuccessPage); echo $SuccessPage; exit; ?>
  9. Thanks for the help everyone! I will start crackin' the books.
  10. I thought that too, but couldn't find one. Very strange. With the softwre I use to write the code, it would stick out like a sore thumb, too. I think I'm going to have to break down and buy a book. I've never had to read a book to learn stuff like this, but I'm sure it will help my understanding of it. Any reccomendations to learn PHP/MySQL?
  11. Of course, now I get this: Not Found The requested URL /transplant/< was not found on this server. At least I'm making progress. If movin from one error to another is progress. I have much to learn...
  12. Thanks fo that. I was under the impression if the action was self to leave it blank. Guess I was wrong. :-) Thanks for the warm welcome.
  13. here it is with the SQL stuff edited out... <?php $db_host = "localhost"; $db_user = "**********"; $db_pwd = "*******"; $db_name = "********"; mysql_connect($db_host, $db_user, $db_pwd); mysql_select_db($db_name); ?> <html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <head> <script type='text/javascript' src='inputmask.js'></script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Transplant Tracking System: ADD PATIENT</title> <style type="text/css"> <!-- .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; } .style2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; } --> </style> </head> <body> <?php if (!isset($_POST['submit'])) { ?> <div align="center" class="style1">Patient Registration </div> <p align="center"></p> <form name="addpatient" method="post" action=""> <div align="center"> <table width="500" border="0" cellspacing="4" cellpadding="0"> <tr> <td width="181"><div align="right"><span class="style1">Patient SSN</span></div></td> <td width="316"><input name="patientssn" type="text" id="patientssn" size="12" onKeyDown="java script:return dFilter (event.keyCode, this, '###-##-####');"> *</td> </tr> <tr> <td width="181"><div align="right"><span class="style1">Last Name</span></div></td> <td width="316"><input name="lastname" type="text" id="lastname"> *</td> </tr> <tr> <td width="181"><div align="right"><span class="style1">First Name</span></div></td> <td width="316"><input name="firstname" type="text" id="firstname"> *</td> </tr> <tr> <td colspan="2"><div align="right" class="style1"></div> </td> </tr> <tr> <td><div align="right" class="style1">FMP</div></td> <td><input name="patientfmp" type="text" id="patientfmp" size="3"> *</td></tr> <tr> <td><div align="right"><span class="style1">Sponsor SSN</span></div></td> <td><input name="sponsorssn" type="text" id="sponsorssn" size="12" onKeyDown="java script:return dFilter (event.keyCode, this, '###-##-####');"> *</td> </tr> <tr> <td><div align="right" class="style1">Date of Birth</div></td> <td><input name="dob" type="text" id="dob" size="10" onKeyDown="java script:return dFilter (event.keyCode, this, '##/##/####');"> *</td> <tr> <td> </td> <td><input type="submit" name="submit" value="submit"></td> </tr> </tr> </table> </div> </form> <p align="center"> </p> <?php } else { $patientssn = $_POST['patientssn']; $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $fmp = $_POST['fmp']; $sponsorssn = $_POST['sponsorssn']; $dob = $_POST['dob']; mysql_query("INSERT INTO `patients` VALUES ('$patientssn', '$firstname', '$lastname' '$fmp' '$sponsorssn' '$dob' )"); echo "Success! Patient has been added!"; } ?> </body> </html> Maybe this needed to be in the MySQL forum????
×
×
  • Create New...