The =1 worked until I rebooted the computer, now it will not work. Can’t understand it.
I replaced your code again and retryed it and it still doesn’t work. I have double checked my phpmyadmin and there is information in basic_info and I can pull it up on another page that is echoing the information
I have copied most of my script I exceeded maxium limits, so I cut down on lists, and here is a copy of the entire page: I hope someone can help.
<?php require_once('../../Connections/emergency.php'); ?>
<?php
function redirect($location,$delay=0)
{
if(headers_sent() === true && $delay <= 0)
{
header("Location: ".$location);
}
else
{
echo $delay == 0 ? ''
: '';
echo '';
}
}
if($totalRows_basic_info > 0)
{
redirect("http://localhost/nameupdate.php");
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO basic_info (primary_key, first_name, middle_int, last_name, dobmonth, dobday, dobyear, address1, address2, city, `state`, zip, home_phone, work_phone, cell_phone) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['hiddenField'], "int"),
GetSQLValueString($_POST['first_name'], "text"),
GetSQLValueString($_POST['middle_int'], "text"),
GetSQLValueString($_POST['last_name'], "text"),
GetSQLValueString($_POST['dobmonth'], "text"),
GetSQLValueString($_POST['dobday'], "int"),
GetSQLValueString($_POST['dobyear'], "int"),
GetSQLValueString($_POST['address1'], "text"),
GetSQLValueString($_POST['address2'], "text"),
GetSQLValueString($_POST['city'], "text"),
GetSQLValueString($_POST['state'], "text"),
GetSQLValueString($_POST['zip'], "int"),
GetSQLValueString($_POST['home_phone'], "text"),
GetSQLValueString($_POST['work_phone'], "text"),
GetSQLValueString($_POST['cell_phone'], "text"));
mysql_select_db($database_emergency, $emergency);
$Result1 = mysql_query($insertSQL, $emergency) or die(mysql_error());
$insertGoTo = "../namereturn.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_emergency, $emergency);
$query_info = "SELECT * FROM basic_info";
$info = mysql_query($query_info, $emergency) or die(mysql_error());
$row_info = mysql_fetch_assoc($info);
$totalRows_info = mysql_num_rows($info);
?>
Untitled Document
My Medical Records Setup
My Information
Please enter the information for the person who will be using this Medical Record usb stick. You can only enter one person.
| |
|
| First Name |
|
| Middle Initial |
|
| Last Name |
|
| Date of Birth |
Month
January
February
March
Please Choose One
|
Day
1
2
3
Please Choose One
|
Year
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
Please Choose One
|
| Address 1 |
|
| Address 2 |
|
| City |
|
| State |
|
| Zip |
|
| Home Phone (xxx-xxx-xxxx) |
|
| Work Phone (xxx-xxx-xxxx) |
|
| Cell Phone (xxx-xxx-xxxx) |
|
| |
|
<!-- end #mainContent --></div>
I would like the information contained on this device to be used in case of an emergency when I can not speak for myself. I agree that I have entered all this information. I will not hold anyone liable for the information contained on this device. I understand that if this device is lost or stolen the information could be viewed by an unauthorized person.
<?php
mysql_free_result($info);
?>