ODBC@localhost errors
Posted: Mon Sep 17, 2007 4:42 am
feyd | Please use
connexion.php
ExSQLConnection.php
when opening the ExSQLConnection.php on a browser, it gives me the following errors:
I tried my best, but can't fgure out what is wrong. Thanks in advance for your help...
++
dave
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi, i am actually a beginner in php, and trying to work with design patterns.
I installed wamp server.
here are my codes:
factoryConnectionTest.phpCode: Select all
<?php
class factoryConnectionTest
{
function factory($dblogin, $dbpass, $dbname, $dbhost)
{
include_once 'connexion.php' ;
return new Connexion($dbhost, $dblogin, $dbpass, $dbname) ;
}
}
?>connexion.php
Code: Select all
<?php
class Connexion
{
private $host;
private $user;
private $pass;
private $base;
public function _construct($hos, $use, $pas, $bas)
{
$this->host = $hos;
$this->user = $use;
$this->pass = $pas;
$this->base = $bas;
connect($this->host, $this->user, $this->pass, $this->base);
}
public function connect($hos, $use , $pas , $bas)
{
mysql_connect('$hos','$use','$pas');
}
}
?>Code: Select all
<?php
include_once "factoryConnectionTest.php" ;
$dblogin = 'root' ;
$dbpassword = '' ;
$dbdatabase = 'test' ;
$dbhost = 'localhost';
$db = factoryConnectionTest::factory($dblogin, $dbpassword, $dbdatabase, $dbhost);
[b]
$reponse = mysql_query("SELECT * FROM jeux_videos"); // RequĂȘte SQL[/b]
while ($donnees = mysql_fetch_array($reponse) )
{
echo $donnees[''];
echo $donnees['possesseur'];
echo $donnees['id'];
}
mysql_close(); // Déconnexion de MySQL
?>Code: Select all
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\FichTelePhp\ExSQLConnection.php on line 12
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\FichTelePhp\ExSQLConnection.php on line 12
Access denied for user 'ODBC'@'localhost' (using password: NO)I tried my best, but can't fgure out what is wrong. Thanks in advance for your help...
++
dave
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]