|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Industry Role:
Join Date: Aug 2003
Location: Canada
Posts: 2,310
|
mysqli prepared statements num_rows
This keeps returning 0 results. Any ideas?
Code:
$qry1 = $db->prepare("SELECT id FROM user WHERE username = ? AND password = ?");
$qry1->bind_param('ss', $_GET['username'], $_GET['password']);
$qry1->execute();
$qry1->store_result();
$result_1 = $qry1->num_rows;
echo $result_1;
|
|
|
|
|
|
#2 | |
|
Just Doing My Own Thing
Industry Role:
Join Date: Jan 2011
Location: London, Spain, New Zealand, GFY - Not Croydon...
Posts: 25,272
|
Quote:
lol - Just kidding - It's a small world... |
|
|
|
|
|
|
#3 |
|
Registered User
Industry Role:
Join Date: Jul 2013
Posts: 82
|
It has to do with binding arrays that are not declared
$params = array('ss', 'stan', 'Stanley'); $tmp = array(); foreach($params as $key => $value) $tmp[$key] = &$params[$key]; call_user_func_array(array($stmt, 'bind_param'), $tmp); use this style. |
|
|
|
|
|
#4 |
|
So Fucking Fossilized
Industry Role:
Join Date: Sep 2011
Posts: 1,432
|
Code:
$db->prepare("SELECT id FROM user WHERE username = ? AND password = ?");
$db->bind_param('ss', $_GET['username'], $_GET['password']);
$db->execute();
$db->store_result();
$result_1 = $db->num_rows;
echo $result_1;
|
|
|
|
|
|
#5 | |
|
Confirmed User
Industry Role:
Join Date: Aug 2003
Location: Canada
Posts: 2,310
|
Quote:
I've searched google but the sites I checked said to include store_result() which I tried but still 0 results returned. |
|
|
|
|