Jump to content

jeff5656

Members
  • Posts

    744
  • Joined

  • Last visited

Everything posted by jeff5656

  1. I get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'leave) VALUES('','', '', '', '','2010-02-11', 'Resolution of indication','y',' at line 1 for this code. Any ideas? I don't see where the syntx error is. $pt_id = mysql_real_escape_string($_POST['pt_id']); $rm_loc_pre = $_POST['rm_loc']; $rm_loc = ereg_replace("[^A-Za-z0-9]", "", $rm_loc_pre); $patient = mysql_real_escape_string($_POST['patient']); $mrn_pre = $_POST['mrn']; $mrn = ereg_replace("[^A-Za-z0-9]", "", $mrn_pre); $remove_date = date("Y-m-d", strtotime($_POST['remove_date'])); $remove_reason = mysql_real_escape_string($_POST['remove_reason']); $suture = mysql_real_escape_string($_POST['suture']); $leave = mysql_real_escape_string($_POST['leave']); $query = "INSERT INTO clines (id, pt_id, patient, rm_loc, mrn, remove_date, remove_reason, suture, leave) VALUES('','$pt_id', '$patient', '$rm_loc', '$mrn','$remove_date', '$remove_reason','$suture', '$leave')"; mysql_query($query) or die(mysql_error());
  2. Oh its a reserved word! I didn't ee that part of your reply. Ok that should do it - I will just rename the table to something else :-)
  3. Yep, it's called lines and I have a fieldname called pt_id.
  4. I get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lines WHERE pt_id = '30'' at line 1 Unfortunately this says the syntax error is in line 1, so I don't know actually where the error is. include "connectdb.php"; $id_incr=$row['id_incr']; $query4 = "SELECT * FROM lines WHERE pt_id = '".$id_incr."' "; echo $query4; $srch = mysql_query ($query4) or die (mysql_error()); while ($row2 = mysql_fetch_assoc ($srch)) { But when I comment out the $srch = line, the error goes away. When I echo out $query4, it echos out correctly. Any ideas? It's gotta be something obvious :-)
  5. That was a really helpful reply! :-) But seriously, does anyone know what could be wrong with my code and why it gives me a syntax error? It's really strange - it looks like it *should* work.
  6. This code worked until I added the variable "change". Weird - is change a reserved word or something? $change = mysql_real_escape_string($_POST['change']); --snip-- $query = "INSERT INTO hrct (hrct_id, pt_id, change, description, hrct_date) VALUES('','$pt_id', '$change', '$description', '$hrct_date')"; mysql_query($query) or die(mysql_error()); The error is You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'change, description, hrct_date) VALUES('','10', '', 'Description', '1969-12-' at line 1 Thank you
  7. When I query these two tables, if a record has no value in pod, it doesn't even get selected: $consultsq1 = "SELECT icu.mrn, icu.id_incr, bundle.pt_id, icu.pod as pod1, bundle.pod as pod2, bundle.vent_id FROM icu INNER JOIN bundle ON icu.id_incr = bundle.pt_id "; $result = mysql_query ($consultsq1) or die ("Invalid query: " . mysql_error ()); while ($row = mysql_fetch_assoc ($result)) { So records where pod is blank in the BUNDLE table, doesn't even get selected when I echo out the while loop.
  8. Thanks I removed the s. Now the first record is echoed and then the error comes up: pod mrn vent it is1,555,323 Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\mc\testbundle.php on line 15
  9. I am joining two tables so I can replace the value in table2 with the value in table 1, (fieldname is pod), but I get this error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\mc\testbundle.php on line 15 $consultsq1 = "SELECT icu.mrn, icu.id_incr, bundle.pt_id, icu.pod as pod1, bundle.pod as pod2, bundle.vent_id FROM icu INNER JOIN bundle ON icu.id_incr = bundle.pt_id "; $result = mysql_query ($consultsq1) or die ("Invalid query: " . mysql_error ()); while ($row = mysql_fetch_assoc ($results)) { $pod= $row['pod1']; $mrn=$row['mrn']; $vent_id=$row['vent_id']; echo "pod mrn vent it is".$pod.",".$mrn.",".$vent_id."<br>"; $sql = "UPDATE bundle SET mrn = '$mrn', pod='$pod' WHERE vent_id = '$vent_id'"; if (isset($sql) && !empty($sql)) { $result = mysql_query($sql) or die ("Invalid querrry: " . mysql_error()); } } WHat I really want to do is search for all reords in bundle where the value of pod is blank, and then replace that blank value with the value of pod from the ICU table. Sorry if this is confusing. But I can;t even get the above simple code to even work...
  10. But I need to query pod from table 1 and pod from table 2, so I need to select BOTH of them (even though they are named the same). When echoing, how do I echo the correct pod. Lets say i want to compare the value of pod in table 1 with the value of pod in table 2 (which is what i want to do)?
  11. I joined two tables. However, both tbles have a fieldname called "pod". How do I echo out that field name so it is from the correct table? $consultsq1 = "SELECT * FROM icu INNER JOIN bundle ON icu.id_incr = bundle.pt_id "; $result = mysql_query ($consultsq1) or die ("Invalid query: " . mysql_error ()); for($n=0;$row = mysql_fetch_assoc ($result);$n++) { echo $row['pod']; } When I echo pod, it gives me it from the icu table but not the bundle table. Thanks!
  12. Ok this may be a simple question but I have this query: $consultsq1 = "SELECT * FROM icu INNER JOIN bundle ON icu.id_incr = bundle.pt_id AND icu.id_incr = '" . $_GET['id'] . "' order by bundle.bundle_date LIMIT 5"; I want to limit the LAST 5, but the above limits the FIRST 5. However, I don't want to change it to DESC order. I want it to be in ascending, but only display the last 5 (newest) records. Thanks!
  13. I have a variable $row['name']. Sometimes the string is smith, John. How do I use regex to only include up to the comma, i.e. $newlastname = smith?
  14. I have a table that displays a bunch of records: <?php $consultsq1 = "SELECT * FROM ild INNER JOIN meds ON ild.id_incr = meds.pt_id AND ild.id_incr = '$id_incr' order by meds.med, meds.startdate"; $result = mysql_query ($consultsq1) or die ("Invalid query: " . mysql_error ()); for($n=0;$row = mysql_fetch_assoc ($result);$n++) { if(!$n) { ?> <table><tr><th >Med</th><th>Dose</th><th>Start Date</th><th >Stop Date</th></tr> <?php } ?> <tr> <td><?php echo $row['med'];?></td> <td><?php echo $row['dose'];?></td> <td><?php echo date("m/d/y ", strtotime($row['startdate']));}?></td> <?php } ?> </table> I want to display the medicine name only the first time ($row['med']) and leave the <td> blank until a record with a different medicine name comes up. How would I do this with the code above? so it would display like this: motrin 50 mg 11/8/09 100 mg 12/8/09 tylenol 500 mg 12/9/09 instead of like this: motrin 50 mg 11/8/09 motrin 100 mg 12/8/09 tylenol 500 mg 12/9/09
  15. never mind i had an undeclared variable in the query.
  16. I have this error, but an't seem to find where it is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' sex, comments, init_date, conf_date, signoff_status) VALUES('','bobby','', '' at line 1 if ($_POST['conf_date']==''){ $conf_date ='2030-01-01'; } else { $conf_date = date("Y-m-d", strtotime($_POST['conf_date'])); } $tx = mysql_real_escape_string($_POST['tx']); $primpulm = mysql_real_escape_string($_POST['primpulm']); $rheum = mysql_real_escape_string($_POST['rheum']); $dx = mysql_real_escape_string($_POST['dx']); $bx = mysql_real_escape_string($_POST['bx']); $bx_date = date("Y-m-d", strtotime($_POST['bx_date'])); $comments = mysql_real_escape_string($_POST['comments']); //add to main table $query = "INSERT INTO ild (id_incr, lname, fname, mrn, physician, primpulm, rheum, dx, bx, bx_date, $datedump, sex, comments, init_date, conf_date, signoff_status) VALUES('$id_incr','$lname','$fname', '$mrn', '$physician','$primpulm','$rheum', '$dx','$bx', '$bx_date','$dob','$sex', '$comments', '$init_date', '$conf_date', 'a')"; mysql_query($query) or die(mysql_error()); $pt_id = mysql_insert_id(); When I echo $query, it does indeed echo back all the values, before giving me the above error.
  17. I downloaded a class to generate graphs but it's not working. Here is the script that genrates the graph: <?php require('chart.php'); require('data.php'); $chart = new chart(300, 200, "example1"); $chart->plot($data); $chart->stroke(); ?> When I run this I get: Fatal error: Call to undefined function imagecreate() in C:\wamp\www\chart\chart.php on line 316 Here is chart.php (sorry it's long) : <?php require('rgb.php'); // The following variables should be edited to fit your // installation. // If debugging is switched on, caching is switched off. $chart_debug = false; // The directory where Chart will store cached images. // Make sure this exists. $chart_cache_directory = "../chart/tmp"; // The default is to generate PNG images. If you set // this to false, GIF images will be generated instead. $chart_use_png = true; // If you want to use Type1 fonts, PHP has to be told // where the IsoLatin1.enc file is. Such a file is included // in the Chart distribution. $type1_font_encoding = "/home/httpd/html/circus/chart/IsoLatin1.enc"; // If your PHP is compiled with gd2, set this variable to true. $gd2 = false; function mod ($n, $m) { $n1 = (int)($n*1000); $m1 = (int)($m*1000); return ($n1 % $m1); } class chart { var $background_color = "white"; var $x_size, $y_size; var $output_x_size = false, $output_y_size; var $plots = array(); var $image; var $left_margin = 30, $right_margin = 10, $top_margin = 20, $bottom_margin = 23; var $margin_color = "white"; var $border_color = "black", $border_width = 1; var $title_text = array(), $title_where = array(), $title_color = array(); var $legends = array(), $legend_background_color = "white", $legend_margin = 8, $legend_border_color = "black"; var $legend_placement = "r"; // left or right var $axes = "xy", $axes_color = "black"; var $grid_color = array(230, 230, 230), $grid_under_plot = 1; var $tick_distance = 25; var $x_ticks = false, $x_ticks_format; var $scale = "linear"; var $cache = false; var $x_label = false, $y_label = false; var $y_format = false; var $font = 2, $font_type = "internal", $font_name = 2, $font_size = 10; var $y_min = array(false), $y_max = array(false), $x_min = array(false), $x_max = array(false); var $frame = false; var $expired = false; var $marked_grid_point = false, $marked_grid_color = false; var $lockfd = -1, $lockfile = 0; var $tick_whole_x = false; var $months = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); var $cleanup_after_plotting = true; function mark_grid ($point = 0, $color = "red") { $this->marked_grid_point = $point; $this->marked_grid_color = $color; } function set_grid_color ($color = false, $grid_under = true) { if ($color) $this->grid_color = $color; $this->grid_under_plot = $grid_under; } function set_output_size ($width, $height) { $this->output_x_size = $width; $this->output_y_size = $height; } function set_expired ($expired) { $this->expired = $expired; } function set_margins ($left = 30, $right = 10, $top = 20, $bottom = 23) { $this->left_margin = $left; $this->right_margin = $right; $this->top_margin = $top; $this->bottom_margin = $bottom; } function set_tick_distance ($distance) { $this->tick_distance = $distance; } function set_labels ($x = false, $y = false) { $this->x_label = $x; $this->y_label = $y; } function set_extrema ($y_min = array(), $y_max = array(), $x_min = array(), $x_max = array()) { if (! is_array($y_min)) $this->y_min = $y_min; if (! is_array($y_max)) $this->y_max = $y_max; if (! is_array($x_min)) $this->x_min = $x_min; if (! is_array($x_max)) $this->x_max = $x_max; } function chart ($x, $y, $cache = false) { error_reporting(1); // If this image has already been cached, then we just spew // it out and exit. if ($cache) $this->get_cache($cache); // If not, we initialize this object and allow execution to continue. $this->x_size = $x; $this->y_size = $y; } function get_cache ($file) { global $chart_debug, $chart_cache_directory, $chart_use_png; $file = $chart_cache_directory . "/" . $file; // There probably is a security problem hereabouts. Just // transforming all ".."'s into "__" and "//"'s into "/_" will // probably help, though. while (ereg("[.][.]", $file)) $file = ereg_replace("[.][.]", "__", $file); while (ereg("//", $file)) $file = ereg_replace("//", "/_", $file); $this->cache = $file; if (! $chart_debug) { while (true) { if (file_exists($file)) { // The chart is already in the cache, so we just serve // it out. if ($file = fopen($file, "rb")) { $this->headers(); fpassthru($file); exit; } } else { // The idea here is to obtain a lock on the file to be // written before starting to write it. That way we // can ensure that no chart is ever generated more // than once, which can be very important if the chart // is CPU intensive. $this->make_directory(dirname($file)); $this->lockfile = "$file.lock"; $lockfd = fopen($this->lockfile, "a"); $tries = 0; while (! flock($lockfd, 2+4) && $tries++ < 200) { sleep(1); } if ($tries >= 200) { // We tried more than 20 seconds, so we delete the // lock file, and try again. fclose($lockfd); unlink($this->lockfile); } else { // We got the lock, so we break from the loop and // return, and generate the chart ourselves. $this->lockfd = $lockfd; break; } } } } return false; } function put_cache ($image) { global $chart_use_png; $file = $this->cache; if (file_exists($file)) unlink($file); $this->make_directory(dirname($file)); // Writing to a tmp file, and then renaming the tmp file to the // real file gives us some atomicity on most sensible file systems. // That is, the real file will never exist in a half-written state. if ($chart_use_png) imagepng($image, "$file.tmp"); else imagegif($image, "$file.tmp"); rename("$file.tmp", "$file"); imagedestroy($image); // Remove the lock file. if ($this->lockfd != -1) { fclose($this->lockfd); unlink($this->lockfile); } if ($file = fopen($file, "rb")) { $this->headers(); fpassthru($file); exit; } return true; } function make_directory ($file) { while (! (file_exists($file))) { $dirs[] = $file; $file = dirname($file); } for ($i = sizeof($dirs)-1; $i>=0; $i--) mkdir($dirs[$i], 0777); } function set_border ($color = "black", $width = 1) { $this->border_color = $color; $this->border_width = $width; } function set_background_color ($color, $margin_color = false) { $this->background_color = $color; if ($margin_color) $this->margin_color = $margin_color; } function set_x_ticks ($ticks, $format = "date") { $this->x_ticks = $ticks; $this->x_ticks_format = $format; } function set_frame ($frame = true) { $this->frame = $frame; } function set_font ($font, $type = 0, $size = false) { $this->font_name = $font; $this->font_type = $type; if ($size) $this->font_size = $size; } function set_title ($title, $color = "black", $where = "center") { $this->title_text[] = $title; $this->title_where[] = $where; $this->title_color[] = $color; } function add_legend($string, $color = "black") { $this->legends[] = array($string, $color); } function set_axes ($which = "xy", $color = "black") { $this->axes = $which; $this->axes_color = $color; } function plot ($c1, $c2 = false, $color = false, $style = false, $to_color = false, $param = false, $texts = false) { $plot = new plot($c1, $c2); if ($color) $plot->set_color($color); if ($to_color) $plot->set_gradient_color($to_color, $param); if ($style) $plot->set_style($style); if ($texts) $plot->set_texts($texts); if ($param) $plot->set_param($param); $this->plots[] = &$plot; return $plot; } function splot ($plot) { $this->plots[] = &$plot; } function stroke ($callback = false) { global $chart_use_png, $type1_font_encoding; $xs = $this->x_size; $ys = $this->y_size; // Load the font for this chart. if ($this->font_type == "type1") { $this->font = imagepsloadfont($this->font_name); imagepsencodefont($this->font, $type1_font_encoding); } elseif ($this->font_type == "ttf") { $this->font = imagettfloadfont($this->font_name); } else { $this->font = $this->font_name; } if ($xs == 0 || $ys == 0) { php3_error(E_ERROR, "Invalid X or Y sizes: (%s, %s)", $xs, $ys); } $im = imagecreate($xs, $ys); $this->image = $im; $bgcolor = $this->allocate_color($this->background_color); imagefilledrectangle($im, 0, 0, $xs, $ys, $bgcolor); list ($xmin, $xmax) = $this->get_extrema(2); list ($ymin, $ymax) = $this->get_extrema(1); $grace = ($ymax-$ymin)*0.01; $ymin -= $grace; $ymax += $grace; if (! is_array($this->y_min)) $ymin = $this->y_min; if (! is_array($this->y_max)) $ymax = $this->y_max; if (! is_array($this->x_min)) $xmin = $this->x_min; if (! is_array($this->x_max)) $xmax = $this->x_max; if ($ymax == $ymin) { $ymax *= 1.01; $ymin *= 0.99; } if ($xmax == $xmin) $xmax++; if ($ymax == $ymin) $ymax++; $xoff = $this->left_margin; $yoff = $this->top_margin; $width = $xs - $this->left_margin - $this->right_margin; $height = $ys - $this->top_margin - $this->bottom_margin; $axes_color = $this->allocate_color($this->axes_color); if ($this->grid_under_plot) { // Draw the grid and the axes. $this->draw_y_axis($im, $ymin, $ymax, $xs, $ys, $height, $yoff, false, $axes_color); $this->draw_x_axis($im, $xmin, $xmax, $xs, $ys, $width, $xoff, false, $axes_color); } if (! $this->cleanup_after_plotting) { $margin = $this->allocate_color($this->margin_color); imagefilledrectangle($im, 0, 0, $xs, $this->top_margin-1, $margin); imagefilledrectangle($im, $xs-$this->right_margin+1, $this->top_margin-1, $xs, $ys, $margin); imagefilledrectangle($im, 0, $ys-$this->bottom_margin+1, $xs, $ys, $margin); imagefilledrectangle($im, 0, 0, $this->left_margin-1, $ys, $margin); } // Go through all the plots and stroke them. if ($callback != false) { $callback($im, $xmin, $xmax, $ymin, $ymax, $xoff, $yoff, $width, $height); } else { for ($i = 0; $i < sizeof($this->plots); $i++) { $plot = $this->plots[$i]; $plot->stroke($im, $xmin, $xmax, $ymin, $ymax, $xoff, $yoff, $width, $height, &$this); } } if (! $this->grid_under_plot) { // Draw the grid and the axes. $this->draw_y_axis($im, $ymin, $ymax, $xs, $ys, $height, $yoff, false, $axes_color); $this->draw_x_axis($im, $xmin, $xmax, $xs, $ys, $width, $xoff, false, $axes_color); } // The plotting may have plotted outside of the allocated // "framed" area (if autoscaling is not in use), so we // blank out the surrounding area. if ($this->cleanup_after_plotting) { $margin = $this->allocate_color($this->margin_color); imagefilledrectangle($im, 0, 0, $xs, $this->top_margin-1, $margin); imagefilledrectangle($im, $xs-$this->right_margin+1, $this->top_margin-1, $xs, $ys, $margin); imagefilledrectangle($im, 0, $ys-$this->bottom_margin+1, $xs, $ys, $margin); imagefilledrectangle($im, 0, 0, $this->left_margin-1, $ys, $margin); } if (! $this->frame) { imageline($im, $this->left_margin, $this->top_margin, $this->left_margin, $ys-$this->bottom_margin+3, $axes_color); imageline($im, $this->left_margin-3, $ys-$this->bottom_margin, $xs-$this->right_margin, $ys-$this->bottom_margin, $axes_color); } else { imagerectangle($im, $this->left_margin, $this->top_margin, $xs-$this->right_margin, $ys-$this->bottom_margin, $this->allocate_color($this->border_color)); } // Put the text onto the axes. $this->draw_y_axis($im, $ymin, $ymax, $xs, $ys, $height, $yoff, true, $axes_color); $this->draw_x_axis($im, $xmin, $xmax, $xs, $ys, $width, $xoff, true, $axes_color); $title_color = $this->allocate_color("black"); // Draw the labels, if any. if ($this->y_label) { if ($this->font_type == "type1") { imagepstext ($im, $this->y_label, $this->font, $this->font_size, $this->allocate_color($title_color), $this->allocate_color("white"), 15, (int)($ys/2+$this->string_pixels($this->y_label)/2), 0, 0, 90, 16); } else { imagestringup($im, $this->font, 5, $ys/2+$this->string_pixels($this->y_label)/2, $this->y_label, $title_color); } } if ($this->x_label) imagestring($im, $this->font, $xs/2-$this->string_pixels($this->x_label)/2, $ys-20, $this->x_label, $title_color); // Draw the boorder. if ($this->border_color) imagerectangle($im, 0, 0, $xs-1, $ys-1, $this->allocate_color($this->border_color)); // Draw the title. $tx = "noval"; for ($i=0; $i<sizeof($this->title_text); $i++) { if ($this->font_type == "type1") { if ($tx == "noval") { if (!strcmp($this->title_where[$i], "center")) { list ($llx, $lly, $urx, $ury) = imagepsbbox($this->title_text[$i], $this->font, $this->font_size); $tx = $xs/2 - ($urx-$llx)/2; } else $tx = 0; } imagepstext ($im, $this->title_text[$i], $this->font, $this->font_size, $this->allocate_color($this->title_color[$i]), $this->allocate_color("white"), (int)$tx, 15, 0, 0, 0, 16); } elseif ($this->font_type == "internal") { if (!strcmp($this->title_where[$i], "center")) $tx = $xs/2 - $this->string_pixels($this->title_text[$i])/2; else $tx = 0; imagestring($im, $this->font, $tx, 5, $this->title_text[$i], $this->allocate_color($this->title_color[$i])); } } // Draw the legend. if (sizeof($this->legends) != 0) { $maxlength = 0; foreach ($this->legends as $legend) { $length = $this->real_string_pixels($legend[0]); if ($length > $maxlength) $maxlength = $length; } if ($this->legend_placement == "r") { $x = (int)($this->x_size - $this->right_margin - $maxlength - 20); $y = (int)($this->top_margin + 20); } else { $x = (int)($this->right_margin + 40); $y = (int)($this->top_margin + 20); } $lmargin = $this->legend_margin; // Draw a box behind the legend. if ($this->legend_background_color) { imagefilledrectangle($im, $x-$lmargin, $y-$lmargin, $x+$lmargin+$maxlength, $y+$lmargin+ (($this->font_size+2)*sizeof($this->legends)), $this->allocate_color($this->legend_background_color)); } if ($this->legend_border_color) { imagerectangle($im, $x-$lmargin, $y-$lmargin, $x+$lmargin+$maxlength, $y+$lmargin+ (($this->font_size+2)*sizeof($this->legends)), $this->allocate_color($this->legend_border_color)); } foreach ($this->legends as $legend) { $this->draw_text($legend[0], $legend[1], $x, $y); $y += $this->font_size+2; } } // Rescale the image before outputting, if requested. if ($this->output_x_size) { global $gd2; $owidth = $this->output_x_size; $oheight = $this->output_x_size; $om = imagecreate($owidth, $oheight); if ($gd2) imagecopyresampled($om, $im, 0, 0, 0, 0, $owidth, $oheight, $xs, $ys); else imagecopyresized($om, $im, 0, 0, 0, 0, $owidth, $oheight, $xs, $ys); $im = $om; } ?> I had to Snip because this forum said I exceeded mximum characters. but the imagecreate term does not appear in what I snipped. Thanks for any help!
  18. When you say something different, what are you referring to? how do I do convert $_POST[dob] to pre-1970 values?
  19. I have a date of birth field: If I enter a dte before 12/31/69, for instance 12/1/55: When I do this $_POST['dob'] I get 12/1/55, but when I do this: $dob = date("Y-m-d", strtotime($_POST['dob'])); echo "dob is ".$dob; I get 12/31/69. Can mysql not store dates before 1969?
  20. In other words, if there is a field called firstname and the user leaves it blank, php does not take it upon itself to insert the value "None", so why does it insert "0000-000-00" when a user leaves a date field blank??
  21. I tried changing null and not null. In both cases a blank is not allowed. If not null, the computer adds 0000-00-00 if the form was blank. If it's null it puts in "null". So basically what I'm asking is, how do I stop the database from putting in a value (000-000-00) when the POST value was BLANK? I am gathering from lack of responses that this is not possible? Does that mean you guys don't have any blank DATE fields??
  22. Ok this is weird. When I add a new DATE field in phpmyadmin nd I browse the records, they all have 0000-00-00 as the value! Does anyone have any odea what is goin on here? If I add a new DATE field with NULL then ALL the records have "Null" as the value.
  23. I read that but they didn't explain what do do if you do NOT want a dummy date. If I go into phpmyadmin and there is a patient smith with dob as "0000-00-00" and I delete that and leave it blank, when I go back to Smith the dob field is back to 0000-00-00! There was even a thread from someone with the same problem here: http://www.phpfreaks.com/forums/index.php?topic=141792 and it was never solved and that was 2007. But what do you guys do if a user leaves a field blank? The database does not accept blank so it stores it as 0000-00-00! Also, I changed the dob field to NULL instead of NOT NULL and it had no effect.
  24. Nope. it still is storing it as 0000-00-00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.