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)
programmer stoped work..HELP on dbconnect.php
Moderator: General Moderators
-
gilbert1989
- Forum Newbie
- Posts: 1
- Joined: Sun Dec 06, 2009 9:34 pm
Re: programmer stoped work..HELP on dbconnect.php
What do you mean?
Don't you know server name, username, ect...
Is that the problem, or do you just not know where to put that information?
Don't you know server name, username, ect...
Is that the problem, or do you just not know where to put that information?
Re: programmer stoped work..HELP on dbconnect.php
you will need to modify the lines:gilbert1989 wrote:it hasnt been configured for my database, name,host, password
Code: Select all
$dbh = mysql_connect($hostname, "xxxxx", "xxxxxx");
mysql_select_db("test",$dbh);Code: Select all
$dbh = mysql_connect($hostname, "YOUR_DB_USERNAME_HERE", "YOUR_DB_PASSWORD_HERE");
mysql_select_db("YOUR_DATABASE_NAME_HERE",$dbh);