Jump to content
  • 0

How to connect my website to mysql,


benching

Question


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

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 :)

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

Use phpMyAdmin module or setup remote MySQL access.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

Is there some tutorials on how to that,

cause it kinda hard to do :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  108
  • Reputation:   0
  • Joined:  08/01/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  1479
  • Reputation:   172
  • Joined:  12/14/11
  • Last Seen:  

\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!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  30
  • Reputation:   2
  • Joined:  12/26/12
  • Last Seen:  

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 :)

Link to comment
Share on other sites

×
×
  • Create New...