Quote:
Originally Posted by Kaperstone
PHP код:
if($run = mysqli_query($con, "SELECT * FROM `users` WHERE `username` = '$username' AND `password` = '$password'")) {
if(mysqli_num_rows($run)) {
while($row = mysqli_fetch_assoc($run)) {
$activation[] = $row['activate'];
}
}else{
echo "no rows";
}
}else{
echo "query error";
}
I guess you're trying to get data from multiple rows, then you will need to add [] at the end, so it will use the last free slot.
|
Comes back as "Array"
Quote:
Originally Posted by Vince
I'm pretty sure you need to specify the "link" parameter if you use procedural style. That's why I prefer object notation.
PHP код:
$db = new mysqli($host, $user, $pass, $db);
if($result = $db->query(...))
{
while($row = $result->fetch_assoc())
{
/* ... */
}
}
// etc
|
I can't get use to that :/