Jump to content

Why Is This Return Always 1


Recommended Posts

Hey all. My site has a config database table that has a column showlogin to set whether or not login functionality is enabled.


I'm playing around with MySQLi, Classes, and Returns.  My return is always 1. Where am I going wrong?



// Start Session

// Production Settings
ini_set('display_errors', 1);

include 'db.php';
$mysqli = new mysqli($host, $user, $pass, $db);

class styles
function showlogin($show)
	global $mysqli;
	$select = $mysqli->query("SELECT showlogin FROM config LIMIT 1");
	$value = $select->fetch_object();

	if ($value->showlogin = 1) { 
		return 1;
	return 0;
$login = new styles();	
echo $login->showlogin($show);

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.