Mombu the Php Forum

Go Back   Mombu the Php Forum > Php > problem with bind_param
User Name
Password
REGISTER NOW! Mark Forums Read




Reply Bookmark and Share
1 23rd October 20:31
ross
External User
 
Posts: 1
Default problem with bind_param



Hi,

I am still having poblems with the php5 functions. I have 4 variables in
each. What is the problem?


Warning: mysqli_stmt::bind_param() [function.mysqli-stmt-bind-param]: Number
of elements in type definition string doesn't match number of bind variables
in xxxx on line 21

$prep = $mysqli->prepare ("UPDATE events SET title=?, date=?, content=?,
imageUrl=?");
$prep->bind_param ( $_POST['title'], $_POST['date'], $_POST['content'],
$_POST['imageUrl']);

thanks,

H.
  Reply With Quote


 


2 23rd October 20:32
jmcentire
External User
 
Posts: 1
Default problem with bind_param



The PHP docs show:

$stmt = $mysqli->prepare("INSERT INTO CountryLanguage VALUES
(?, ?, ?, ?)");
$stmt->bind_param('sssd', $code, $language, $official, $percent);

for usage. Your $prep->bind_param() doesn't seem to include the
definitions. 'sssd' in the above example, string, string, string,
decimal. Further, you should probably make sure that your $_POST
data is set and isn't null or a variable type other than what is
expected.

Jeremy Mcentire
Ant Farmer
ZooToo LLC
  Reply With Quote
Reply


Thread Tools
Display Modes


Some other forums that might be of your interest : Php 5 forum, Apache forum, Iis forum, Functions forum, Classes forum, Librarys forum, Bugs forum, Postgres forum, Mysql forum, Paradox forum, Ms sql forum, Configurations forum, Php.ini forum, Problems forum, Scripting forum, Css forum, General forums, Off-topic talk, Links, Extra forums, Php


Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666