Problem connecting form to database


i'm having trouble connecting form database. mysql connection , recordset tests okay, in liveview or live on site i'm getting:

 

 

warning: require_once(connections/grphlth.php) [function.require-once]: failed open stream: no such file or directory in /home/williaco/public_html/empinfo.php on line 1

 

fatal error: require_once() [function.require]: failed opening required 'connections/grphlth.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in

/home/williaco/public_html/empinfo.php on line 1

 

the php code:

<?php require_once('connections/grphlth.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;
}
}

mysql_select_db($database_grphlth, $grphlth);
$query_recordset1 = "select * empinfo";
$recordset1 = mysql_query($query_recordset1, $grphlth) or die(mysql_error());
$row_recordset1 = mysql_fetch_assoc($recordset1);
$totalrows_recordset1 = mysql_num_rows($recordset1);
?>

i figured 1 out.  and, yes, stupid!



More discussions in Develop server-side applications in Dreamweaver


adobe

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO