나는 데이터베이스에 연결하려고 시도했지만 불행히도 전혀하지 않습니다. 맨 아래에 스크립트가 있습니다. 먼저 스크립트를 가리켜 서 이상한 점이 있는지 궁금해합니다.PHP를 통해 데이터베이스에 연결
필자가 조사한 바에 따르면 필자가 작성한 php 방법은 작고 똑같은 작년을 사용했다는 것을 알았습니다.
연결되지 않는다는 것을 분명히하는 것은 무엇이든지 알려줍니다.
감사합니다.
connect.php :
<?php
$connect_error = 'Sorry, we\'re experiencing connection problems.';
mysql_connect('localhost', 'devdegre_ddevlin', 'password123') or die($connect_error);
mysql_select_db('devdegre_logreg') or die($connect_error);
?>
init.php : I는 사용자 데이터베이스를 생성하는 SQL을 덤프하고 사용자가 입력 한
<?php
session_start();
//error_reporting(0);
require 'database/connect.php';
require 'functions/general.php';
require 'functions/users.php';
$current_file = explode('/', $_SERVER['SCRIPT_NAME']);
$current_file = end($current_file);
if (logged_in() === true) {
$session_user_id = $_SESSION['user_id'];
$user_data = user_data($session_user_id, 'user_id', 'username', 'password',
'first_name', 'last_name', 'email', 'password_recover', 'type',
'allow_email', 'profile');
if (user_active($user_data['username']) === false) {
session_destroy();
header('Location: index.php');
exit();
}
if ($current_file !== 'changepassword.php' && $user_data['password_recover'] == 1) {
header('Location: changepassword.php?force');
exit();
}
}
$errors = array();
?>
. 항상 connect.php로 이동하여 사용자 이름, 암호 등을 연결하는 다양한 방법을 시도해 보았습니다.
mysql.it가 사용되지 않습니다. – Nick
당신이'user_data()'함수를 보여주지 않았기 때문에 우리는 당신을 도울 수 없습니다. –
당신은 아마 google 'OOP 프로그래밍'도해야합니다 ... – RichardBernards