Koozali.org: home of the SME Server

Hi I have problems getting PHP to connecte with the mysql database.

Offline alm7100

  • *
  • 8
  • +0/-0
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

Offline alm7100

  • *
  • 8
  • +0/-0
Re: Hi I have problems getting PHP to connecte with the mysql database.
« Reply #1 on: April 10, 2008, 05:48:26 PM »
Hmm its looklike its Session that dosent works???????

Offline byte

  • *
  • 2,183
  • +2/-0
Re: Hi I have problems getting PHP to connecte with the mysql database.
« Reply #2 on: April 10, 2008, 06:56:47 PM »
Moving this topic to the SME 7.x contribs forum, it is more appropriate there. Thanks!
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline arne

  • *****
  • 1,116
  • +0/-4
Re: Hi I have problems getting PHP to connecte with the mysql database.
« Reply #3 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.
......

Offline alm7100

  • *
  • 8
  • +0/-0
Re: Hi I have problems getting PHP to connecte with the mysql database.
« Reply #4 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

Offline m

  • *****
  • 276
  • +0/-0
  • Peet
Re: Hi I have problems getting PHP to connecte with the mysql database.
« Reply #5 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?

Offline warren

  • *
  • 293
  • +0/-0
Re: Hi I have problems getting PHP to connecte with the mysql database.
« Reply #6 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
« Last Edit: April 11, 2008, 09:14:09 PM by warren »

Offline m

  • *****
  • 276
  • +0/-0
  • Peet
Re: Hi I have problems getting PHP to connecte with the mysql database.
« Reply #7 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");

Offline arne

  • *****
  • 1,116
  • +0/-4
Re: Hi I have problems getting PHP to connecte with the mysql database.
« Reply #8 on: April 12, 2008, 02:53:52 AM »
How it works here:

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

mysql_db_query ($DBName, $Query, $Link)
......