close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Error message when I try to store data

Thread began 9/28/2014 3:05 pm by Per-Olof | Last modified 3/24/2015 4:38 pm by Jason Byrnes | 2148 views | 11 replies |

Per-Olof

Error message when I try to store data

I get this error message when I try to store data

( ! ) Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in C:\wamp\www\Test-teamet\webassist\mysqli\queryobj.php on line 123

Call Stack
# Time Memory Function Location
1 0.0010 205832 {main}( ) ..\laguttagning_i.php:0
2 0.0140 329328 WA_MySQLi_Query->execute( ) ..\laguttagning_i.php:24
3 0.0140 332104 call_user_func_array:{C:\wamp\www\Test-teamet\webassist\mysqli\queryobj.php:123} ( ) ..\queryobj.php:123


( ! ) Fatal error: Call to a member function execute() on a non-object in C:\wamp\www\Test-teamet\webassist\mysqli\queryobj.php on line 124
Call Stack
# Time Memory Function Location
1 0.0010 205832 {main}( ) ..\laguttagning_i.php:0
2 0.0140 329328 WA_MySQLi_Query->execute( ) ..\laguttagning_i.php:24

This worked in the old MySQL.
What have I done wrong?

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

Per-Olof

see the private message section

Sign in to reply to this post

Jason ByrnesWebAssist

this is caused by using numbers for column names which is not strictly allowed.

to work around the probelm, you will need to edit the code to add slant quotes (`) around the column name, for example, change:

$InsertQuery->bindColumn("1", "i", "".((isset($_POST["s1"]))?$_POST["s1"]:"")  ."", "WA_DEFAULT");



to:

$InsertQuery->bindColumn("`1`", "i", "".((isset($_POST["s1"]))?$_POST["s1"]:"")  ."", "WA_DEFAULT");



and do that for each column that uses a number for it's name.

Sign in to reply to this post

Per-Olof

Thanks but
Is not it easier to change in the table, column 1 becomes s1, 2 becomes s2 and so on.
there will be less problems in the future if one forgets.

Sign in to reply to this post

Jason ByrnesWebAssist

yes, that would be easier.

Sign in to reply to this post

stephen287384

Originally Said By: Jason Byrnes
  this is caused by using numbers for column names which is not strictly allowed.

to work around the probelm, you will need to edit the code to add slant quotes (`) around the column name, for example, change:

$InsertQuery->bindColumn("1", "i", "".((isset($_POST["s1"]))?$_POST["s1"]:"")  ."", "WA_DEFAULT");


to:
$InsertQuery->bindColumn("`1`", "i", "".((isset($_POST["s1"]))?$_POST["s1"]:"")  ."", "WA_DEFAULT");


and do that for each column that uses a number for it's name.  
Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

stephen287384

PM

Sign in to reply to this post

Jason ByrnesWebAssist

see pm

Sign in to reply to this post
loading

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...