Jump to content
php.lv forumi

Mysql Connection


didy

Recommended Posts

OS: WinXP

Uzstadiju: Apache2.2.8, php5.2, mysql 5.0

Problema: nevaru piesaistiit mysql db

 

parbaude - ieks index.php

 

<?php
$link = mysql_connect('localhost', 'lietotajvards', 'manaparole');
if (!$link) {
  die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

 

Izmet man:

Fatal error: Call to undefined function mysql_connect() in E:\folderis\index.php on line 8

 

meginaju citu variantu:

 

<?
require ($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");
$connection = @mysql_connect($db_host, $db_user, $db_password) or die ("error connecting");
echo "connection made";
?>

 

ar papildus failu kurs norada $db_host, $db_user, $db_password

 

Sini gadijuma neuzrada pilniba neko! KO es varetu but aizmirsis nokonfiguret? Vai varbut ko nepareizu izdarijis!

Edited by didy
Link to comment
Share on other sites

meginaju citu variantu:

 

<?
require ($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");
$connection = @mysql_connect($db_host, $db_user, $db_password) or die ("error connecting");
echo "connection made";
?>

 

ar papildus failu kurs norada $db_host, $db_user, $db_password

 

Sini gadijuma neuzrada pilniba neko! KO es varetu but aizmirsis nokonfiguret? Vai varbut ko nepareizu izdarijis!

 

 

Varbūt vispirms iemācies kāda nozīme ir @ un tad saki, ka neko neatgriež!

Link to comment
Share on other sites

×
×
  • Create New...