Jump to content
  • 0

Σύνδεση Ιστοσελίδας Με Database


TEOGR_hItMaKeR

Question

Χαίρεται παιδιά ... Θέλω να ρωτήσω αν μπορείτε να με βοηθήσετε να συνδέσω την ιστοσελίδα μου κάποια σκρίπτ με την database δεν ξέρω και αν είναι το σωστό μέρος εδώ βέβαια απλά επειδή σχετίζεται με το l2j το κάνω εδώ

 

έβαλα στο host την ip του σερβερ στο user kai to pass το mysql user και το pass και το ονομα της db 

αλλα φορτωνει 1 ωρα η σελιδα και δεν ανοιγει ... 

 

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

ean den kanw kapoio lathos nomizw prepei sto mysql to enabe root access na einai on episis prepei na einai on to port 3306 (default 3306) meta vazeis stixia db ktp sta config kai douilevi logika etsi eixa kanei egw kai doulepse toulaxiston. elpizw na doulepsi kai gia esena

Link to comment
Share on other sites

  • 0

Ti script vazeis?

Edit: prepei na kaneis new user sto navicat kai na doseis ola ta privs ston user auto meta apo ekei vazeis sto site to name host ip kai pass

Edited by Reborn12
Link to comment
Share on other sites

  • 0

Έχω ανοίξει το πορτ 3306 ... τι διαφορά έχει από το να χρησιμοποιήσω τον ίδιο χρήστη; το δοκίμασα αυτό αλλά και πάλι :/ σκριπτ για να δείχνει διαφορά στατς στην σελίδα

Link to comment
Share on other sites

  • 0

Έχεις βάλει την Mysql να δέχεται σύνδεση απέξω;

ναι οταν έκανα install το mysql 

 

 

Dokimase na ala3is to localhost se % sto user

 

ok

Edited by TEOGR_hItMaKeR
Link to comment
Share on other sites

  • 0

Kalhspera file mou ,mporeis na kaneis post to script pou kaneis sundesh thn istoselida me thn vasi? (xoris ta pragmatika stoixeia ennweite)

Link to comment
Share on other sites

  • 0

O tropos sundesis pou xroishmopoio egw einai o eksis,

mesa sthn selida php vazo ena define :

"  require_once 'dbconnect.php';  "

to opoio periexei ta stoixeia ths sundesis:

<?php
 
error_reporting( ~E_DEPRECATED & ~E_NOTICE );
define('DBHOST', 'localhost'); // xxx.xxx.xxx.xxxx:3306 (x is ip // 3306 is the port)
define('DBUSER', 'root'); 
define('DBPASS', ''); 
define('DBNAME', 'l2jdb'); 
 
$conn = mysql_connect(DBHOST,DBUSER,DBPASS);
$dbcon = mysql_select_db(DBNAME);
 
if ( !$conn ) { //check.if connection fail
die("Connection failed : " . mysql_error());
}
 
if ( !$dbcon ) { //check.if connection fail
die("Database Connection failed : " . mysql_error());
}
Link to comment
Share on other sites

  • 0

Ρε παιδιά έλεος καμία βοήθεια; να ποστάρω τον κώδικα; (δε νομίζω να έχει λάθος) ...

Edited by TEOGR_hItMaKeR
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...