Re: problem with bind_param

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


On Oct 29, 2007, at 9:51 AM, Hulf wrote:

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.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux