View Single Post
Old 10-09-2012, 10:53 PM   PM User | #76
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,667
Thanks: 45
Thanked 456 Times in 444 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
Quote:
Originally Posted by LearningCoder View Post
Edit:Just ran the same print_r($stmt) code through my localhost and it is also returning affected_rows -1 but it lets me login....
Quote:
Originally Posted by tangoforce View Post
As it's a select statement you should be using num_rows() not affected_rows() which is for insert, update, delete etc.
Remember what I said ? - You are still looking at affected_rows() and talking about it! You even got me following that idea and scratching my head again.

Lets stick with num_rows() and have no more mention of affected_rows() since we're not affecting anything.

Quote:
Originally Posted by LearningCoder View Post
Well it seems nowadays you're the only one who replies to me so I might have to seek a bit of advice from another forum or something because my last 2-3 threads are replied to only by yourself, no one else helps me lol.
Don't take that personally. It's true your requests for help do turn into multi-page topics but that isn't unusual, it just shows your determination to get to the bottom of it.

What it does do however is scare off those who are less experienced because they know that they're not able to support your request for help. Those are the sort of people who will purely guess at something without really understanding debugging. Generally around here once you've got a reasonably respected helper assisting you, others will leave you to it unless you miss something and its glaring them in the face. It's kind of a silent understanding between those who donate time here. There are many here who would help you - Fou-Lu, firepages, Sppokster, Inigoesdr, Lamped and ShaneC to name a few (those were taken from the mod list - but there are others who are not mods). If you've ever heard the proverb "Too many cooks spoil the broth" then you'll understand it.

Don't be put off codingforums, I'm also on sitepoint but I find it a site that is 'PR heavy'. In other words its highly advertised as the expert site but the quality of support can be a bit low sometimes. I've found that codingforums is actually a lot better.

Quote:
Originally Posted by LearningCoder View Post
This is what is being returned:

Code:
mysqli_stmt Object
(
    [affected_rows] => -1
    [insert_id] => 0
    [num_rows] => 0
    [param_count] => 2
    [field_count] => 7
    [errno] => 2014
    [error] => Commands out of sync; you can't run this command now
    [sqlstate] => HY000
    [id] => 1
)
Regards,

Lc.
Which line of code output that? - The error does have a message so I'd like you to repost your code and point out which line has the error by putting a comment in please.
__________________
Please don't be rude: Put your php code in [php][/php] tags. It is a sticky topic at the top of the forum and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.

Last edited by tangoforce; 10-09-2012 at 10:56 PM..
tangoforce is online now   Reply With Quote