can anyone help me with php
#1

http://straccicompany.tk/ucp/?p=login

hi guys, im testing out some sorta ucp and it outputs a warning, deprecation, error, whatever.. can you tell me what's it for and what do I have to change to fix it?

thanks in advance
Reply
#2

You should use a newer tutorial, but just because you wont; Simply change mysql_ to mysqli_
Reply
#3

i tried that, whole site turned into errors and it kept refreshing itself constantly

edit; changed mysql_ to mysqli_ now, check the site now..
http://straccicompany.tk/ucp/
Reply
#4

anyone?
Reply
#5

Show the mysqli_select_db & mysqli_error code.
Reply
#6

Код:
<?php

////\\\\\\\\\\\\\\\\\\\\\\EDIT The Below Variables\\\\\\\\\\\\\\\\\
////\\\\\\\\\\\\\\\\\\\ONLY EDIT WITHIN THE QUOTATION MARKS ("")\\\
//
$servername = "n10.ultra-h.com"; //Server name (usually "localhost")
$database = "port_5930";    //Database name (often username_databasename)
$username = "port_5930";        //User name for MySQL Database
$password = "*******";          //Password for MySQL User name
//
//// \\\\\\\\\\\\\\\\\\\\\\\DO NOT EDIT BELOW\\\\\\\\\\\\\\\\\\\\\\\
//
$connect = mysqli_connect($servername,$username,$password);
    mysqli_select_db($database, $connect) or die(mysqli_error());

?>
so here's the whole config.php i hope it helps

thanks in advance
Reply
#7

Update

Try Check Parameter function mysqli_connect

PHP код:
<?php
$con 
mysqli_connect("HOST""USER""PASSWORD""DBNAME");

if (!
$con) {
    echo 
"Error: Mysql Conection." PHP_EOL;
    exit;
}

echo 
"Ready: Success " PHP_EOL;

?>
Reply
#8

"mysqli_select_db" asks for a database name (string) and you gave that function an integer ($connect).
The first parameter should be "$connect" and the second parameter "$database":

PHP код:
<?php
////\\\\\\\\\\\\\\\\\\\\\\EDIT The Below Variables\\\\\\\\\\\\\\\\\
////\\\\\\\\\\\\\\\\\\\ONLY EDIT WITHIN THE QUOTATION MARKS ("")\\\
//
$servername "n10.ultra-h.com"//Server name (usually "localhost")
$database "port_5930";    //Database name (often username_databasename)
$username "port_5930";        //User name for MySQL Database
$password "*******";          //Password for MySQL User name
//
//// \\\\\\\\\\\\\\\\\\\\\\\DO NOT EDIT BELOW\\\\\\\\\\\\\\\\\\\\\\\
//
$connect mysqli_connect($servername,$username,$password);
    
mysqli_select_db($connect$database) or die(mysqli_error($connect));
?>
You could also combine it directly with "mysqli_connect":

PHP код:
<?php
////\\\\\\\\\\\\\\\\\\\\\\EDIT The Below Variables\\\\\\\\\\\\\\\\\
////\\\\\\\\\\\\\\\\\\\ONLY EDIT WITHIN THE QUOTATION MARKS ("")\\\
//
$servername "n10.ultra-h.com"//Server name (usually "localhost")
$database "port_5930";    //Database name (often username_databasename)
$username "port_5930";        //User name for MySQL Database
$password "*******";          //Password for MySQL User name
//
//// \\\\\\\\\\\\\\\\\\\\\\\DO NOT EDIT BELOW\\\\\\\\\\\\\\\\\\\\\\\
//
$connect mysqli_connect($servername,$username,$password,$database);
// Check connection
if (mysqli_connect_errno())
{
    echo 
"Failed to connect to MySQL: " mysqli_connect_error();
}
?>
Reply
#9

Quote:
Originally Posted by Macronix
Посмотреть сообщение
"mysqli_select_db" asks for a database name (string) and you gave that function an integer ($connect).
The first parameter should be "$connect" and the second parameter "$database":

PHP код:
<?php
////\\\\\\\\\\\\\\\\\\\\\\EDIT The Below Variables\\\\\\\\\\\\\\\\\
////\\\\\\\\\\\\\\\\\\\ONLY EDIT WITHIN THE QUOTATION MARKS ("")\\\
//
$servername "n10.ultra-h.com"//Server name (usually "localhost")
$database "port_5930";    //Database name (often username_databasename)
$username "port_5930";        //User name for MySQL Database
$password "*******";          //Password for MySQL User name
//
//// \\\\\\\\\\\\\\\\\\\\\\\DO NOT EDIT BELOW\\\\\\\\\\\\\\\\\\\\\\\
//
$connect mysqli_connect($servername,$username,$password);
    
mysqli_select_db($connect$database) or die(mysqli_error($connect));
?>
You could also combine it directly with "mysqli_connect":

PHP код:
<?php
////\\\\\\\\\\\\\\\\\\\\\\EDIT The Below Variables\\\\\\\\\\\\\\\\\
////\\\\\\\\\\\\\\\\\\\ONLY EDIT WITHIN THE QUOTATION MARKS ("")\\\
//
$servername "n10.ultra-h.com"//Server name (usually "localhost")
$database "port_5930";    //Database name (often username_databasename)
$username "port_5930";        //User name for MySQL Database
$password "*******";          //Password for MySQL User name
//
//// \\\\\\\\\\\\\\\\\\\\\\\DO NOT EDIT BELOW\\\\\\\\\\\\\\\\\\\\\\\
//
$connect mysqli_connect($servername,$username,$password,$database);
// Check connection
if (mysqli_connect_errno())
{
    echo 
"Failed to connect to MySQL: " mysqli_connect_error();
}
?>
i tried that before
Reply
#10

what YOU are doing :
Quote:

mysqli_select_db($database, $connect) or die(mysqli_error());

What it SHOULD be :
Quote:

mysqli_select_db($connect, $database) or die(mysqli_error());

$connect is first parameter not $db !!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)