The msql.php code that you provided never worked bro just kept getting 500 error tried putting it on all pages even the core and also tried it by adding it to config and it never worked
PHP Version 5.6 to 7
Collapse
X
-
Think i may have to start from scratch lol already getting problems converting the database lol
function connectbase() {
global $dbname, $dbuser, $dbhost, $dbpass;
$conms = @mysqli_connect($dbhost,$dbuser,$dbpass);
if(!$conms) return false;
$condb = @mysqli_select_db($dbname);
if(!$condb) return false;
return true;
}
Comment
-
I'm not sure why the above script is causing a 500, I'm guessing placed in wrong place.
your code should be:
PHP Code:function connectbase() {
global $dbname, $dbuser, $dbhost, $dbpass;
$conms = @mysqli_connect($dbhost,$dbuser,$dbpass);
if(!$conms) return false;
$condb = @mysqli_select_db($conms,$dbname);
if(!$condb) return false;
return true;
}
So to get it out of the function you can either return $conms:
PHP Code:function connectbase() {
global $dbname, $dbuser, $dbhost, $dbpass;
$conms = @mysqli_connect($dbhost,$dbuser,$dbpass);
if(!$conms) return false;
$condb = @mysqli_select_db($conms,$dbname);
if(!$condb) return false;
return $conms;
}
$conms = connectbase();
then you can use it inside mysqli functions such as:
PHP Code:$id = mysqli_fetch_array(mysqli_query($conms, "SELECT id FROM ibwf_users WHERE name='".$name."'"));
or alternatively you could use it outside of the function eg:
PHP Code:$conms = @mysqli_connect($dbhost,$dbuser,$dbpass);
function connectbase() {
global $conms, $dbname;
if(!$conms) return false;
$condb = @mysqli_select_db($conms,$dbname);
if(!$condb) return false;
return true;
}
Last edited by something else; 30.12.18, 20:15.
Comment
-
You either have to pass it into the function via its variables:
PHP Code:function doSomething($sid, $conms) {
}
or a quicker method would be to use a global variable:
[php]
PHP Code:function doSomething($sid) {
global $conms;
}
Comment
-
It will fade and you will resign the php to 7 it will not be hard ;) just holes people getting hacked though php 5.7 soon enough php_shell can't be used..Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
Visit: WapMasterz Coming Back Soon!
_______
SCRIPTS FOR SALE BY SUBZERO
Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
_______
Info & Tips
php.net
w3schools.com
Comment
Comment