Answer the question
In order to leave comments, you need to log in
What does this mean? Warning: mysqli_fetch_array(): The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH in?
Why is it throwing this error?
Warning: mysqli_fetch_array(): The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH in
$search_user = mysqli_fetch_array(mysqli_query
($connect,"SELECT * FROM `accounts` WHERE `nickname` = '".$plogin."' AND `password` = '".$ppass."'"), 0);
Answer the question
In order to leave comments, you need to log in
Actually
#include <algorithm>
#include <iterator>
#include <iostream>
#include <vector>
using namespace std;
auto fx = [](int x){
int r = 0;
switch(x % 3)
{
case 0:
r = x * x;
break;
case 1:
r = x;
break;
default:
r = x / 3;
break;
}
return r;
};
auto calculate = [](const vector<int>& vx, auto fx){
vector<int> calcValues(vx.size());
transform(vx.begin(), vx.end(), calcValues.begin(), fx);
return calcValues;
};
int main()
{
cout << "Введи кол-во чисел: ";
int n = 0;
cin >> n;
cout << "Введи через пробел " << n << " натуральных чисел:\n" << "$: ";
vector<int> values(n);
copy_n(istream_iterator<int>(cin), n, values.begin());
cout << "Результат твоих расчетов:\n";
copy_n(calculate(values, fx).begin(), n, ostream_iterator<int>(cout, "\n"));
}
Even though I'm "Mr. stupid advice MMXVII", but try this strange nonsense:
$result = mysqli_query($connect, "SELECT * FROM `accounts` WHERE `nickname` = '".$plogin."' AND `password` = '".$ppass."'");
if (mysqli_num_rows($result) == 1) {
/* типо есть аккаунт */
} else {
/* типо нет аккаунта */
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question