close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Fatal error: Uncaught mysqli_sql_exception: Commands out of sync

Thread began 3/07/2022 5:18 am by georgina_barrett_187762 | Last modified 3/09/2022 10:33 am by Ray Borduin | 274 views | 3 replies |

georgina_barrett_187762

Fatal error: Uncaught mysqli_sql_exception: Commands out of sync

I built a content manager for a website and then copied it to another website.
Everything seems to work ok when I test it through Dreamweaver. The recordsets all seem to work and the insert/update scripts all connect to the database and seem to work. The problem comes when i try and view the files online I am getting this error:


Fatal error: Uncaught mysqli_sql_exception: Commands out of sync; you can't run this command now in /home/mywebsite/public_html/webassist/mysqli/rsobj.php(587) : eval()'d code:1 Stack trace: #0 /home/mywebsite/public_html/webassist/mysqli/rsobj.php(587) : eval()'d code(1): mysqli_stmt_store_result() #1 /home/mywebsite/public_html/webassist/mysqli/rsobj.php(587): eval() #2 /home/mywebsite/public_html/webassist/mysqli/rsobj.php(235): WA_MySQLi_RS->waMySQLiResultFetchAssoc() #3 /home/mywebsite/public_html/manager/Client_ID.php(24): WA_MySQLi_RS->execute() #4 {main} thrown in /home/mywebsite/public_html/webassist/mysqli/rsobj.php(587) : eval()'d code on line 1

**UPDATE**

I can see what is causing the problem, but I don't know why.

This recordset works fine:
<?php
$Recordset1 = new WA_MySQLi_RS("Recordset1",$connect_i,0);
$Recordset1->setQuery("SELECT * FROM customercontacts");
$Recordset1->execute();
?>

But this recordset throws that error:
<?php
$Recordset1 = new WA_MySQLi_RS("Recordset1",$connect_i,0);
$Recordset1->setQuery("SELECT * FROM customercontacts WHERE customercontacts.RefID=?");
$Recordset1->bindParam("i", "".((isset($_GET["ID"]))?$_GET["ID"]:"") ."", "-1"); //colname
$Recordset1->execute();
?>

It seems to throw the error when you have a variable.

Could it have something to do with the hosting? I normally use a different provider (and have never had this problem) but I am using 123-reg to host this site

Sign in to reply to this post

Ray BorduinWebAssist

Is customercontacts a table or a view in the database?

Maybe try opening the rsobj.php file and turn off prepared statements. Let me know if that makes a difference.

Sign in to reply to this post
Did this help? Tips are appreciated...

georgina_barrett_187762

Thank you!

customercontacts is a table.

I turned off prepared statements in the rsobj.php file (for anyone else looking how to do this change line 27 to - $this->Prepared = false;)
and it worked!

I am a designer and don't really understand too much coding - what does this mean? Will it effect anything by doing this?

Sign in to reply to this post

Ray BorduinWebAssist

There is a bug in one version of php and or mysqli that causes prepared statements to not work properly. Prepared statements uses built in mysql functionality to prevent SQL injection. When you turn it off, it uses a webassist version of SQL Injection protection in its place.

It really shouldn't make a difference. In fact the recordset should run a little faster.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...