Musqli prepared statements
Moderator: General Moderators
- feinstimmer
- Forum Newbie
- Posts: 19
- Joined: Thu Dec 07, 2006 8:36 am
Musqli prepared statements
I have table with colom colled- ID, and it is int, not null, auto_increment and primary key.If i try to insert values in that table using msqli prepared statement, which specification character i use for bind_param for ID colom and which value has to be inserted to that colom?Thanks in advance!!
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- feinstimmer
- Forum Newbie
- Posts: 19
- Joined: Thu Dec 07, 2006 8:36 am
I am still learning, trying to make registration script using prepered statements to store data in DB.Everything is working till now or et least i can myself make it work except that problem i posted. Didn't read much about stored procedures, is that better solution?Even if it is, i would like to get answer on my question.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Musqli prepared statements
feinstimmer wrote:I have table with colom colled- ID, and it is int
feinstimmer wrote:which specification character i use for bind_param for ID colom
The PHP Manual page for [url=http://www.php.net/manual/en/function.mysqli-stmt-bind-param.php]mysqli_stmt_bind_param[/url] wrote:Code: Select all
i corresponding variable has type integer
- feinstimmer
- Forum Newbie
- Posts: 19
- Joined: Thu Dec 07, 2006 8:36 am
Ok, i solved it, missed one "?" in prepare and used "i' for specification character.Variable $id needed in bind_param but value is not needed.Thank you Everah.
Last edited by feinstimmer on Mon Nov 19, 2007 9:56 am, edited 1 time in total.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA