Re: [PHP-DB] mysqli_stmt_bind_param question

[email protected] (Jason Pruim)
Newsgroups php.db
Message-ID <[email protected]>
Hi Krister,

On Apr 4, 2008, at 2:35 PM, Krister Karlström wrote:
> Hi!
>
> First of all you must connect to the server and then perform an init  
> to get a statement. Maybe you dropped that code out here... Please  
> have a look at the manual page:
>
> http://www.php.net/manual/en/function.mysqli-stmt-prepare.php
>
> In order to get the result you also need to bind the result to a  
> variable and then fetch the data.
>
> I'll guess that your error comes from an unsuccessful initialization  
> of your prepared statement.
>
> If you don't want to include your primary key column that is  
> autogenerated you just ignore it. That means to write a proper query  
> like:
>
> INSERT INTO legioCurrent (column_1, column_2, ...)
> VALUES (?,?,...)

I was not aware with prepared statements you could do it that way...  
Thank you! Once I added that it worked like a charm! Not quite sure  
how I missed that on the manuel page though...

>
>
> I would also like to propose for you to use the object oriented  
> style, since it's more readable and easier to get an overview of.

I have never been able to understand OO code... For me the procedural  
code is much easier to read.



> You also don't need to mess around with so many parameters.

What do you mean by this?

>
>

--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.