0

the following code would always return false

<?php
    require "connectDB.php";
    $query = "SELECT * FROM useraccout WHERE 1";
    $rows = $db->query($query);

By false I believe it means that there is something wrong with the statement (can't find what exactly is wrong)

connectDB.php

<?php

$USERNAME = "root";
$PASSWORD = "";
$DB_NAME = "db";
$SERVER = "localhost";

$db = mysqli_connect($SERVER, $USERNAME, $PASSWORD, $DB_NAME);
MASHED TRACKS
  • 120
  • 1
  • 9

2 Answers2

0

more information are required but from your code here is what i found 1) query = "SELECT * FROM useraccout WHERE 1";

is this useraccout right? or is it not supposed to be useraccount

2) please upload a screen shot of your database and useraccout structure

Triple0t
  • 444
  • 3
  • 9
0

In you query need to specify the column name to compare

<?php
require "connectDB.php";
$query = "SELECT * FROM useraccout WHERE column_name=1";
$rows = $db->query($query);

Like if you want to compare with id then the query is

$query = "SELECT * FROM useraccout WHERE id=1"; 

If you want to select all records from table useraccout then the query is

SELECT * FROM useraccout;
Sukhjinder Singh
  • 479
  • 3
  • 15