Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: alm7100 on April 10, 2008, 05:04:43 PM

Title: Hi I have problems getting PHP to connecte with the mysql database.
Post by: alm7100 on April 10, 2008, 05:04:43 PM
Hi I have problems getting PHP to connecte with the mysql database.

I Know that my script works 100%

Btw its the same when i trye to install joomla, it cat connect to the database at all.

I have install phpmyadmin and can connect with admin and password that works..

Some that can give/show the right the way to me.

Using sme 7.3
Title: Re: Hi I have problems getting PHP to connecte with the mysql database.
Post by: alm7100 on April 10, 2008, 05:48:26 PM
Hmm its looklike its Session that dosent works???????
Title: Re: Hi I have problems getting PHP to connecte with the mysql database.
Post by: byte on April 10, 2008, 06:56:47 PM
Moving this topic to the SME 7.x contribs forum, it is more appropriate there. Thanks!
Title: Re: Hi I have problems getting PHP to connecte with the mysql database.
Post by: arne on April 10, 2008, 08:24:09 PM
Quote
Hi I have problems getting PHP to connecte with the mysql database.

I Know that my script works 100%

If they did, there would not be any posting here, would it ?

If anybody should come up with some idea why a script is not working, or connectiong to the data base, it might be a idea to post some parts of the script here, so it could be tested.
Title: Re: Hi I have problems getting PHP to connecte with the mysql database.
Post by: alm7100 on April 10, 2008, 09:30:02 PM
Hi Arne

No that right sorry

Here is the line thats fail..

  $connect = @mysql_connect($_SESSION['MYSQL_SERVER'],$_SESSION['MYSQL_LOGIN'],$_SESSION['MYSQL_PASS']) or die('1000.');


Its has ben used and works on my wampserver (on windows)

The database and everything is like on the wampserver...

i have tryed to insert the date harcore (repleast $_SESSION['MYSQL_SERVER'] and the others with the data)

Sorry for my english :-)

Iam danish ss
Title: Re: Hi I have problems getting PHP to connecte with the mysql database.
Post by: m on April 10, 2008, 10:10:46 PM
alm7100,
not very useful that code snippet you've posted.
Just a thought: Are you aware that the mysql daemon on SME by default is listening on a socket and not on a port?
Title: Re: Hi I have problems getting PHP to connecte with the mysql database.
Post by: warren on April 11, 2008, 06:02:25 PM
alm7100

this has always worked for me;

<?
$linkID = mysql_connect ("localhost", "user", "password");
   
mysql_select_db ("dbname", $linkID);

?>

Thanks for spotting the brain fart  :D mweinber
Title: Re: Hi I have problems getting PHP to connecte with the mysql database.
Post by: m on April 11, 2008, 07:30:46 PM
$linkID = mysql_connect ("localhost", "dbname", "password");
I guess you have meant
$linkID = mysql_connect ("localhost", "user", "password");
Title: Re: Hi I have problems getting PHP to connecte with the mysql database.
Post by: arne on April 12, 2008, 02:53:52 AM
How it works here:

$Link = mysql_connect ($Host, $User, $Password);

mysql_db_query ($DBName, $Query, $Link)