programmer stoped work..HELP on dbconnect.php
Posted: Sun Dec 06, 2009 9:38 pm
pretty much had a guy write a script to load data into a database, using Wampserver, from a website. Paid him and then went to use it and it hasnt been configured for my database, name,host, password etc, and of course he wont help now for free.
anyone that can help?
(code) <?php
function opendb(){
$hostname = "localhost";
$dbh = mysql_connect($hostname, "root", "emileb7_")
or die("Unable to connect to MySQL");
mysql_select_db("test",$dbh)
or die("Could not open database!");
return;
}//end function
function cleaninput($userinput){
$newinput = mysql_real_escape_string(strip_tags(htmlentities($userinput)));
return $newinput;
}//end function
function croak($errorstring){
echo 'A database error occurred. The error is:<br> '.$errorstring;
// echo 'An error has occured, most likely while interacting with our database. Please try your request again. If this error persists, please notify the webmaster.';
$errstring='the following error occured: '.$errorstring;
// logtofile('generrors.log', $errstring);
}//end function
function logtofile($filename, $msg){
$mybase = "/home/rgrentr5/logs/";
$fd = fopen($mybase.$filename, "a");
// append date/time to message
$str = "[" . date("Y/m/d h:i:s", mktime()) . "] " . $msg;
fwrite($fd, $str . "\n");
fclose($fd);
}//end function
?>
(code)
anyone that can help?
(code) <?php
function opendb(){
$hostname = "localhost";
$dbh = mysql_connect($hostname, "root", "emileb7_")
or die("Unable to connect to MySQL");
mysql_select_db("test",$dbh)
or die("Could not open database!");
return;
}//end function
function cleaninput($userinput){
$newinput = mysql_real_escape_string(strip_tags(htmlentities($userinput)));
return $newinput;
}//end function
function croak($errorstring){
echo 'A database error occurred. The error is:<br> '.$errorstring;
// echo 'An error has occured, most likely while interacting with our database. Please try your request again. If this error persists, please notify the webmaster.';
$errstring='the following error occured: '.$errorstring;
// logtofile('generrors.log', $errstring);
}//end function
function logtofile($filename, $msg){
$mybase = "/home/rgrentr5/logs/";
$fd = fopen($mybase.$filename, "a");
// append date/time to message
$str = "[" . date("Y/m/d h:i:s", mktime()) . "] " . $msg;
fwrite($fd, $str . "\n");
fclose($fd);
}//end function
?>
(code)