How to create sql insert query dynamically in mysql

Posted by nectar on Stack Overflow See other posts from Stack Overflow or by nectar
Published on 2010-06-02T05:43:59Z Indexed on 2010/06/02 5:53 UTC
Read the original article Hit count: 280

Filed under:
|
|

I am creating an application where I am generating pins dynamically based on user's input and storing them into mySql database.

$sql = "INSERT INTO tblpin ('pinId', 'ownerId', 'usedby', 'status') 
    VALUES
        for($i=0;$i<$npin;$i++)
        {
            ('$pin[$i]','$ownerid', 'Free', '1');
        }
    ;";

how can I do that?

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql