 |
...by design
|
|
function db_connect()
{
///////////////////////////////////////[ username ] [password]
$result = @mysql_pconnect("localhost", "wisguy", "clsfwx137");
if (!$result)
return false;
////////////////// [database name]///
if (!@mysql_select_db("stipich"))
return false;
return $result;
}
function my_dbconnect(){
// connect to the database
MYSQL_CONNECT("localhost", "wisguy", "clsfwx137") OR DIE("Unable to connect to database");
@mysql_select_db("stipich") or die( "Unable to select database");
}
function get_writer_record($username)
{
$conn = db_connect();
$sql = "select * from writers where username = '$username'";
$result = mysql_query($sql, $conn);
return(mysql_fetch_array($result));
}
function get_story_record($story)
{
$conn = db_connect();
$sql = "select * from stories where id = '$story'";
$result = mysql_query($sql, $conn);
return(mysql_fetch_array($result));
}
?> | |