Just to make sure I understand... The code you posted shows three insert statements, one for each table, and these all work okay, as expected, right?
You said: "when I used this methods to insert data into multiple or more tables, the data just insert into the 1st table and no activity in the 2nd and 3rd table" but you did not show any code that tried to do that, so you have not shown the code that fails to do you want. Do I have that right?
If so, then the problem is that in MySQL (and, I think, in any database that supports "Structured Query Language"), the "INSERT" statement only works on one table at a time. You cannot do anything like "INSERT into table1, table2, table3 ( table1.col_x, table2.col_y, table3_col_z ) values (?,?,?)".
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|