A
A
Anton Fedoryan2015-11-04 18:33:16
PHP
Anton Fedoryan, 2015-11-04 18:33:16

Denver. How to fix fatal error call to undefined function mysql_connect db()?

<?php
    $login = iconv('UTF-8', 'windows-1251', $_GET['lge']);
    $pass = iconv('UTF-8', 'windows-1251', $_GET['lgp']);

    // Подключение к MySQL
    $mysql = mysql_connect("127.0.0.1", "anton", "1234567");
    if (!$mysql) {
        echo('enter');
        exit;
    }

    // Выбор нужной базы
    $selected = mysql_connect_db("alfa", $mysql);
    if (!$selected) {
        echo('base');
        exit;
    }

I'm trying to connect to a database. throws an error
fatal error call to undefined function mysql_connect db()

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
look2009, 2015-11-04
@AnnTHony

/* создать соединение */ 
mysql_connect($hostname,$username,$password) OR DIE("Не могу создать соединение "); 
/* выбрать базу данных. Если произойдет ошибка - вывести ее */ 
mysql_select_db($dbName) or die(mysql_error());

Why $mysql =

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question