Jump to content
  • 0

How to connect my website to mysql,


Question

Posted

how can i connect my website to my sql in my computer,

i want to connect my mysql database in my computer to my website,

A small info could be a great help,

Thanks :)

5 answers to this question

Recommended Posts

Posted

\config\servers.php

There, you can edit to where will the FluxCP connect your MySQL.

Btw, mind telling us what your CP is? StarsGames? Flux? Ceres? others?

Have a nice day!

Posted

You can do this with a php file

<?php
$ip = 'localhost';
$user = 'usernameofmysql';
$pw = 'pwofmysql';
$db = 'dbofmysql';
$conn = mysql_connect($ip, $user, $pw) or die(mysql_error());
mysql_select_db($conn, $db);
?>

This will only connect your website with your mysql database you will still need to do queries

ex

$query = 'SELECT * FROM table WHERE x = y';
$result = mysql_query($query) or die(mysql_error());
while ( $row = mysql_fetch_assoc($result) )
{
echo "This is the result from each row:";
echo $row['columname'];
}

hope this helped a little :)

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...